Alpha Video Training
Results 1 to 15 of 15

Thread: XML

  1. #1
    VAR
    Real Name
    Andy Meer
    Join Date
    Mar 2005
    Location
    Atherstone UK
    Posts
    452

    Default XML

    Hi All,

    Below is a script that has been generated by converting a browse to xdialog with an embedded browse.

    Can anybody tell me how I can get the value of a selected row object ie the SMB_REF

    Andy

    Code:
    dim dlg_title as c 
    dim dlg_body as c 
    dim dlg_event as c 
    dim browseObj1_browse_definition as c 
    dim browseObj1_tablename as c 
    
    browseObj1_tablename = "stock.dbf"
    
    dim flagIsActiveLinkTable as l 
    flagIsActiveLinkTable = a5_is_activelinktable("stock.dbf")
    
    'If the browse is based on an ActiveLink table then it is necessary to include
    'the {statusarea} directive in the Xdialog definition. This is where progress is reported
    'when the active-link table is fetching records from the server.
    dim StatusAreaCommand as c = ""
    if flagIsActiveLinkTable then 
    	StatusAreaCommand = "{sp=.5}{statusarea=100,1};"
    end if 
    
    dlg_title = "Browse in Xdialog"
    
    dlg_body = <<%dlg%
    'If you include the {removecomments} command, any line that starts with an single quote will be treated as a comment.
    {removecomments}
    {can_exit=close}
    {startup=init}
    {xmargin=0}{ymargin=0}
    {stretch=height,width}
    {watch=browseObj1.mode_get()!modechange}
    {card=175,20BrowseCard_browseObj1};
    {stretch=}
    {stickto=bottom,left}
    __StatusArea__;
    <%T=Go to first record;B=T;I=$$navigate.first%!browseObj1_NavigateFirst>
    <%T=Go to previous record;B=T;I=$$navigate.prev%!browseObj1_NavigatePrevious>
    <%T=Go to next record;B=T;I=$$navigate.next%!browseObj1_NavigateNext>
    <%T=Go to last record;B=T;I=$$navigate.last%!browseObj1_NavigateLast>
    {sp=3}
    
    <%T=Find by key;B=T;I=$a5_find_by_key%!browseObj1_FindByKey>
    {sp=3}
    <%T=Sort in ascending order;B=T;I=$$sort%!browseObj1_SortAscending>
    <%T=Sort in descending order;B=T;I=$$sort.descending%!browseObj1_SortDescending>
    {sp=3}
    <%T=Save record;B=T;I=$a5_save%!browseObj1_SaveRecord?.not.(browseObj1.mode_get()="view")>
    {sp=3}
    <%T=Refresh;B=T;I=$$generic.refresh.color%!browseObj1_RefreshRecord?(browseObj1.mode_get()="view")>
    {sp=3}
    ;
    
    {stickto=bottom,right}
    {justify=right}
    ;;;
    <10&Amend!amend><10&Close!close>;
    
    
    
    %dlg%
    
    dlg_body = stritran(dlg_body,"__StatusArea__",StatusAreaCommand)
    
    
    dlg_event = <<%code%
    if a_dlg_button = "close" then 
    	ui_modeless_dlg_close(dlg_title)
    end if 
    
    if a_dlg_button = "amend" then
    	a_dlg_button = ""
    	ui_msg_box("Notice","User clicked the OK button."+browseObj1_SMB_REF)
    end if 
    
    
    
    
    if a_dlg_button = "init"
            a_dlg_button = ""    
            browseObj1 = a5_XdialogDefaultBrowse(dlg_title,"Browsecard_browseObj1",browseObj1_tablename,"browseObj1_browse_definition")
            'The status bar is only shown if the browse is based on an active-link table.
            'When the browse is fetching data from the server, the status bar displays progress.
            'However, when the browse is not fetching from the server, if the 'status_format' is not set to null, then 
            'the status bar will display 'Record x'. Since we don't want any display, we set the status_format to null.
            'Note that the status_format can be set to any expression that evaluates in the context of the current record.
            'e.g. "Record for" + lastname
            browseObj1.Status_format = "\"\""
    end if
    
    if a_dlg_button = "browseObj1_NavigateFirst" then 
    	a_dlg_button = ""
    	browseObj1.Fetch_First()
    else if a_dlg_button = "browseObj1_NavigateNext" then 
    	a_dlg_button = ""
    	browseObj1.Fetch_Next()
    
    else if a_dlg_button = "browseObj1_NavigatePrevious" then 
    	a_dlg_button = ""
    	browseObj1.Fetch_Prev()
    else if a_dlg_button = "browseObj1_NavigateLast" then 
    	a_dlg_button = ""
    	browseObj1.Fetch_Last()
    else if a_dlg_button = "browseObj1_FindByKey" then 
    	a_dlg_button = ""
    	browseObj1.Find()
    
    else if a_dlg_button = "browseObj1_SortAscending" then 
    	a_dlg_button = ""
    	browseObj1.command("SORT_ASCENDING")
    else if a_dlg_button = "browseObj1_SortDescending" then 
    	a_dlg_button = ""
    	browseObj1.command("SORT_DESCENDING")
    
    else if a_dlg_button = "browseObj1_SaveRecord" then 
    	a_dlg_button = ""
    	browseObj1.commit()
    else if a_dlg_button = "browseObj1_RefreshRecord" then 
    	a_dlg_button = ""
    	browseObj1.command("REFRESH")
    end if 
    
    %code%
    
    browseObj1_browse_definition = <<%xml%
    <browse restrict_change="yes" restrict_delete="yes" gridline_horizontal="yes" gridline_vertical="yes" data_entry_style="default" row_height="16" order="Smb_ref+Stock_code">
    <title showtitles="yes" color="System-ButtonFace" accent_color="System-ButtonHighlight" fill_style="Gradient Horizontal" line_style="solid" line_color="System-ThreeDShadow" top="2" onclick_behaviour="Select">
    	<font color="System-ButtonText" name="Arial" size="8"/>
    	<flyover color="#224,244,244" accent_color="#195,195,195" fill_style="Gradient Horizontal"/>
    	<selected color="#241,193,95" accent_color="#249,217,159" fill_style="Gradient Horizontal" font_color="System-ButtonText"/>
    	<focused color="#242,149,54" accent_color="#255,213,141" fill_style="Gradient Horizontal" font_color="System-ButtonText"/>
    </title>
    <background color="White" accent_color="Black" fill_style="Transparent"/>
    <row_selector color="Win3D" accent_color="Black" fill_style="Transparent" line_style="solid" line_color="System-ThreeDShadow">
    	<selected color="#255,213,141" accent_color="Black" fill_style="Solid"/>
    	<focused color="#241,192,92" accent_color="Black" fill_style="Solid"/>
    </row_selector>
    <splitter color="Win3D"/>
    <horizontal line_color="System-ButtonFace" line_style="solid"/>
    <vertical line_color="System-ButtonFace" line_style="solid"/>
    <separator_top line_style="default"/>
    <separator_bottom line_style="default"/>
    <separator_left line_style="default"/>
    <separator_right line_style="default"/>
    <cells>
    	<cell color="#255,255,255" accent_color="#255,255,255" fill_style="solid" font_color="#0,0,0" count="1"/>
    	<cell color="#244,244,255" accent_color="#244,244,255" fill_style="solid" font_color="#0,0,0" count="1"/>
    </cells>
    <selected color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
    <focused color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
    <currentrow color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
    <currentcolumn color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
    <new_record_appearance color="Win3D" accent_color="Off White" fill_style="Transparent"/>
    <font size="2"/>
    <font size="2"/>
    <columns>
    	<column name="SMB_REF" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="Tahoma" size="8"/>
    		<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="White" style="Transparent"/>
    		<shadow style="None"/>
    		<entry name="stock-&gt;SMB_REF" width="25"/>
    		<object name="SMB_REF" column_title="SMB_REF" width="1.5"/>
    	</column>
    	<column name="GRADE" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="Tahoma" size="8"/>
    		<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="White" style="Transparent"/>
    		<shadow style="None"/>
    		<entry name="stock-&gt;GRADE" width="3"/>
    		<object name="GRADE" column_title="GRADE" width="0.791666666666667"/>
    	</column>
    	<column name="SUPPLR_REF" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="Tahoma" size="8"/>
    		<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="White" style="Transparent"/>
    		<shadow style="None"/>
    		<entry name="stock-&gt;SUPPLR_REF" width="25"/>
    		<object name="SUPPLR_REF" column_title="SUPPLR_REF" width="1.5"/>
    	</column>
    	<column name="STOCK_CODE" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="Tahoma" size="8"/>
    		<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="White" style="Transparent"/>
    		<shadow style="None"/>
    		<entry name="stock-&gt;STOCK_CODE" width="4"/>
    		<object name="STOCK_CODE" column_title="STOCK_CODE" width="0.791666666666667"/>
    	</column>
    	<column name="DESCRIPT" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="Tahoma" size="8"/>
    		<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="White" style="Transparent"/>
    		<shadow style="None"/>
    		<entry name="stock-&gt;DESCRIPT" width="32"/>
    		<object name="DESCRIPT" column_title="DESCRIPT" width="2.5"/>
    	</column>
    	<column name="QTY" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="Tahoma" size="8"/>
    		<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="White" style="Transparent"/>
    		<shadow style="None"/>
    		<entry name="stock-&gt;QTY" width="6"/>
    		<object name="QTY" column_title="QTY" width="0.666666666666667"/>
    	</column>
    	<column name="REORDLEVEL" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="Tahoma" size="8"/>
    		<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="White" style="Transparent"/>
    		<shadow style="None"/>
    		<entry name="stock-&gt;REORDLEVEL" width="5"/>
    		<object name="REORDLEVEL" column_title="REORDLEVEL" width="0.791666666666667"/>
    	</column>
    </columns>
    </browse>
    %xml%
    dim pg as p
    pg.BodyText = "Use This Browse To Find Stock Levels" + crlf(2)+\
    "Please Use The Buttons At The Bottom Of The Form To Search For Products"
    pg.HeadingText = "    Stock Levels"
    pg.Image = "smblogo"
    
    dlg_body = "{XdialogTitleSection=150,7pg};{lf};" + crlf() + dlg_body
    
    
    'Now, display the Xdialog.
    ui_dlg_box(dlg_title,dlg_body,dlg_event)

  2. #2
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: XML

    browseObj1.SMB_REF.value

    You can use browseObj1 as the top object pointer in the same way you would use topparent for the regular browse.

    Notice how browseObj1 is used in the code for the navigation buttons ie browseObj1.Fetch_First()
    Last edited by Tim Kiebert; 01-10-2009 at 08:11 AM.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  3. #3
    VAR
    Real Name
    Andy Meer
    Join Date
    Mar 2005
    Location
    Atherstone UK
    Posts
    452

    Default Re: XML

    Hi Tim

    Works great

    Thankyou

    Andy

  4. #4
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: XML

    No problems.

    I have put them (browses in xDialogs) to use recently so knew right away what you were asking. I put two browses in one dialog as a lookup/find tool. It works like a progressive find against two different sets of tables at the same time. I really like the way you get the full functionality of all the new browse gadgets like buttons and bubble help etc not to mention the regular color equation. And also the ability to style the browse with a style sheet used throughout the app. then just plunck it in to the xdialog.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  5. #5
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: XML

    I had not played with this feature before, so this thread was a nice prompt to do so.

    One question. It looks like the browse can not be resized smaller than the card dimensions. Would be nice if the card deminisons were the initial size, but the user could resize larger (can do) or smaller (can't).

    Bill.

  6. #6
    VAR
    Real Name
    Andy Meer
    Join Date
    Mar 2005
    Location
    Atherstone UK
    Posts
    452

    Default Re: XML

    Hi Bill

    The developer can resize the browse, but I have not found yet where to resize the window but I am sure we must be able to

    Andy

  7. #7
    VAR
    Real Name
    Andy Meer
    Join Date
    Mar 2005
    Location
    Atherstone UK
    Posts
    452

    Default Re: XML

    Hi Tim

    I have put them (browses in xDialogs) to use recently so knew right away what you were asking. I put two browses in one dialog as a lookup/find tool. It works like a progressive find against two different sets of tables at the same time. I really like the way you get the full functionality of all the new browse gadgets like buttons and bubble help etc not to mention the regular color equation. And also the ability to style the browse with a style sheet used throughout the app. then just plunck it in to the xdialog.

    your post intrigued me so I have been looking at how I would put the two browses in to one xdialog, but I have not managed to do it correctly, I wonder if you would so kind as to post an example of how this is accomplished

    Andy

  8. #8
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: XML

    Sure thing.

    This was one of my early attempts. It is just two of the alphasports browses from the browse tab. I also included the new header section for each browse.

    Save the file and then import into the code tab of Alphasports.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  9. #9
    VAR
    Real Name
    Andy Meer
    Join Date
    Mar 2005
    Location
    Atherstone UK
    Posts
    452

    Default Re: XML

    Hi Tim

    Sorry I am back again,

    I have the two browses in the same xdialog, as the are working fine.

    I have put a watch expression in my form to allow the user to select a supplier

    {watch=pruchhead1.SUPPLIER.value!name_change}
    I also have a variable VOrdernum

    The top browse is the supplier
    The second browse is the order items

    I want to be able to sort the second browse by the variable Vordernum

    I have also put a watch expression in for the Vordernum

    {watch=Vordernum!name_change}
    I have found the line in the XML that filters the browse which works if I set the value to
    Order_no = &quot;02944&quot;
    Can you give me some idea how to do this dynamically

    Andy

  10. #10
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: XML

    Hi Andy, no aplologies neccessary.

    I am not clear on whether you want to filter or sort or both the second browse. Also, what is the relation ship of the vOrdernum variable to the xdialog. Is it on the dialog or on the form that calls the cdialog?

    The method I am using is that of using the browse object name (in your case 'pruchhead1') like you would topparent in the browse. Then I have a variable on the xdialog that supplies the change event(rather than a watch expression).
    In response to this event I have a line of code similar to this.
    Code:
    pruchhead2.QuickSortExplicit("Order_no")
    and if you want to filter the browse use the queryrun function like
    Code:
    filter = "Ordernum = ' " + vOrdernum + " ' "
    pruchhead2.queryrun(filter)
    Another way would be to insert a place holder (say __BROWSE_FILTER__ )in the xml in place of the filter and order and then construct the text that would go in its place with the usual character functions and variable substitution. Like

    __BROWSE_FILTER__ = "Order_no = &quot;"+Vordernum+"&quot;"


    Then use strtran() to replace the place holder. Then you would need to redo the xml on each change event with a line similar to

    Code:
    browseObj1 = a5_XdialogDefaultBrowse(dlg_title,"Browsecard_browseObj1",browseObj1_tablename,"browseObj1_browse_definition")
    This would have the affect of rebuilding the browse each time.

    Hope this helps.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  11. #11
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: XML

    Hi Tim,

    How do I make the filtered XML-Browse List before open an xdialog? -
    or Could you tell me which code is generate the lists?
    or Hide the XML-Browse Data until change a variable value?

    Code:
    
    dim dlg_title as c 
    dim dlg_body as c 
    dim dlg_event as c 
    dim browseObj1_browse_definition as c 
    dim browseObj1_tablename as c 
    
    browseObj1_tablename = "product.dbf"
    
    dim flagIsActiveLinkTable as l 
    flagIsActiveLinkTable = a5_is_activelinktable("product.dbf")
    
    'If the browse is based on an ActiveLink table then it is necessary to include
    'the {statusarea} directive in the Xdialog definition. This is where progress is reported
    'when the active-link table is fetching records from the server.
    dim StatusAreaCommand as c = ""
    if flagIsActiveLinkTable then 
    	StatusAreaCommand = "{sp=.5}{statusarea=100,1};"
    end if 
    
    dlg_title = "Browse in Xdialog"
    
    'vendor list
    DIM vVendor_rl_def as C 
    vVendor_rl_def = "k=vendor,{keylist_build(\"H=.05,1:25\",''+vendor_id,left(''+name,25))}{}"
    
    
    
    dlg_body = <<%dlg%
    'If you include the {removecomments} command, any line that starts with an single quote will be treated as a comment.
    {removecomments}
    {can_exit=close}
    {startup=init}
    {xmargin=0}{ymargin=0}
    {region}
    Filter here and should be hidden. *How  and where?;
    find the product by Vendor: [%@vVendor_rl_def%.30vVendorId!vFindVendor_changed];
    {endregion};
    
    {stretch=height,width}
    	{watch=browseObj1.mode_get()!modechange}
    	{card=110,10BrowseCard_browseObj1};
    {stickto=width,bottom}
    {region}
    <close>
    {endregion};	
    %dlg%
    
    dlg_body = stritran(dlg_body,"__StatusArea__",StatusAreaCommand)
    
    
    dlg_event = <<%code%
    if a_dlg_button = "close" then 
    	ui_modeless_dlg_close(dlg_title)
    end if 
    if a_dlg_button = "init"
            a_dlg_button = ""    
            browseObj1 = a5_XdialogDefaultBrowse(dlg_title,"Browsecard_browseObj1",browseObj1_tablename,"browseObj1_browse_definition")
            'The status bar is only shown if the browse is based on an active-link table.
            'When the browse is fetching data from the server, the status bar displays progress.
            'However, when the browse is not fetching from the server, if the 'status_format' is not set to null, then 
            'the status bar will display 'Record x'. Since we don't want any display, we set the status_format to null.
            'Note that the status_format can be set to any expression that evaluates in the context of the current record.
            'e.g. "Record for" + lastname
            browseObj1.Status_format = "\"\""
    end if
    
    If a_dlg_button ="vFindVendor_changed" then
    	msgbox(vVendorId)
    	browseObj1.queryRun("vendor_id="+quote(vVendorId))  
    	'find the product_id by vendor_id from table and set the filter again
    '	vFoundList = table.external_record_content_get("product","product_id","product_id","vendor_id="+quote(vVendorId))
    '	vFoundList = alltrim(vFoundList)
    '	vfilter = *for_each(x,"Product_id="+quote(x),vFoundList)
    '	vfilter = alltrim(vfilter)
    '	vfilter = stritran(vfilter, crlf(), " .or. ")
    '	browseObj1.queryRun("product_id="+quote(vfilter))
    	a_dlg_button =""
    end if
    
    if a_dlg_button = "browseObj1_NavigateFirst" then 
    	a_dlg_button = ""
    	browseObj1.Fetch_First()
    else if a_dlg_button = "browseObj1_NavigateNext" then 
    	a_dlg_button = ""
    	browseObj1.Fetch_Next()
    
    else if a_dlg_button = "browseObj1_NavigatePrevious" then 
    	a_dlg_button = ""
    	browseObj1.Fetch_Prev()
    else if a_dlg_button = "browseObj1_NavigateLast" then 
    	a_dlg_button = ""
    	browseObj1.Fetch_Last()
    else if a_dlg_button = "browseObj1_FindByKey" then 
    	a_dlg_button = ""
    	browseObj1.Find()
    
    else if a_dlg_button = "browseObj1_SortAscending" then 
    	a_dlg_button = ""
    	browseObj1.command("SORT_ASCENDING")
    else if a_dlg_button = "browseObj1_SortDescending" then 
    	a_dlg_button = ""
    	browseObj1.command("SORT_DESCENDING")
    
    else if a_dlg_button = "browseObj1_SaveRecord" then 
    	a_dlg_button = ""
    	browseObj1.commit()
    else if a_dlg_button = "browseObj1_RefreshRecord" then 
    	a_dlg_button = ""
    	browseObj1.command("REFRESH")
    end if 
    
    %code%
    
    browseObj1_browse_definition = <<%xml%
    <browse width="1211" height="494" data_entry_style="modeless" restrict_enter="yes" restrict_change="yes" restrict_delete="yes" restrict_find="yes" restrict_range="yes" restrict_index="yes" restrict_query="yes" gridline_horizontal="yes" gridline_vertical="yes" outline_level="1" restrict_column_resize="yes" restrict_column_move="yes" restrict_column_delete="yes" restrict_split="yes" restrict_outlining="yes" row_height="13" order="DESCRIPTION">
    <title showtitles="yes" color="Win3D" accent_color="White" fill_style="Gradient Horizontal" line_style="solid" line_color="Gray-25" top="2" onclick_behaviour="Select">
    	<font color="Black" name="Tahoma" size="8" bold="yes"/>
    	<flyover color="#224,244,244" accent_color="#195,195,195" fill_style="Gradient Horizontal"/>
    	<selected color="#241,193,95" accent_color="#249,217,159" fill_style="Gradient Horizontal" font_color="Black"/>
    	<focused color="#242,149,54" accent_color="#255,213,141" fill_style="Gradient Horizontal" font_color="Black"/>
    </title>
    <background color="Win3D" accent_color="Black" fill_style="Transparent"/>
    <row_selector color="Win3D" accent_color="Win3D" fill_style="Solid" line_style="solid" line_color="Gray-25">
    	<selected color="#255,213,141" accent_color="Black" fill_style="Solid"/>
    	<focused color="#241,192,92" accent_color="#0,0,0" fill_style="Solid"/>
    </row_selector>
    <splitter color="Win3D"/>
    <horizontal line_color="Gray-40" line_style="default"/>
    <vertical line_color="Gray-40" line_style="default"/>
    <separator_top line_style="default"/>
    <separator_bottom line_style="default"/>
    <separator_left line_style="default"/>
    <separator_right line_style="default"/>
    <cells>
    	<cell color="#255,255,255" accent_color="#255,255,255" fill_style="solid" font_color="#0,0,0" count="1"/>
    	<cell color="#244,244,255" accent_color="#244,244,255" fill_style="solid" font_color="#0,0,0" count="1"/>
    </cells>
    <selected color="#225,228,233" accent_color="#0,0,0" fill_style="Solid"/>
    <focused color="#210,213,218" accent_color="#0,0,0" fill_style="Solid"/>
    <currentrow color="#225,228,233" accent_color="Black" fill_style="Solid"/>
    <currentcolumn color="#225,228,233" accent_color="Black" fill_style="Solid"/>
    <new_record_appearance color="Win3D" accent_color="Off White" fill_style="Gradient Horizontal"/>
    <font size="2"/>
    <font size="2"/>
    <initial width="1211" height="494"/>
    <font size="2"/>
    <font size="2"/>
    <calculated><![CDATA[QTY_TO_ORDER = IF(Qty_In_Sto>=Re_Order,0,Re_Order-Qty_In_Sto)
    ]]></calculated>
    <columns>
    	<column name="Product_Id" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="MS Sans Serif" size="8"/>
    		<border color="Black" style="No border" width="1" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="Winback" style="Solid"/>
    		<shadow style="None"/>
    		<entry name="product-&gt;PRODUCT_ID" width="12"/>
    		<object name="Product_Id" column_title="Product Id" width="0.729166666666667"/>
    	</column>
    	<column name="Description" align="Left" text_format="None">
    		<font color="&lt;default&gt;" name="MS Sans Serif" size="8"/>
    		<border color="Black" style="No border" width="1" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="Winback" style="Solid"/>
    		<shadow style="None"/>
    		<entry name="product-&gt;DESCRIPTION" width="32"/>
    		<object name="Description" column_title="Description" width="2.28125"/>
    	</column>
    	<column name="Cost" align="Right" text_format="None">
    		<font color="&lt;default&gt;" name="MS Sans Serif" size="8"/>
    		<border color="Black" style="No border" width="1" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="Winback" style="Solid"/>
    		<shadow style="None"/>
    		<entry name="product-&gt;COST" width="7" dec="2" format="$("/>
    		<object name="Cost" column_title="Cost" width="0.5"/>
    	</column>
    	<column name="Price" align="Right" text_format="None">
    		<font color="&lt;default&gt;" name="MS Sans Serif" size="8"/>
    		<border color="Black" style="No border" width="1" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="Winback" style="Solid"/>
    		<shadow style="None"/>
    		<entry name="product-&gt;RETAIL" width="7" dec="2" format="$("/>
    		<object name="Price" column_title="Price" width="0.510416666666667"/>
    	</column>
    	<column name="Qty" align="Center" text_format="None">
    		<font color="&lt;default&gt;" name="MS Sans Serif" size="8"/>
    		<border color="Black" style="No border" width="1" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="Winback" style="Solid"/>
    		<shadow style="None"/>
    		<entry name="product-&gt;QTY_IN_STO" width="6"/>
    		<object name="Qty" column_title="Qty" width="0.541666666666667"/>
    	</column>
    	<column name="Reorder" align="Center" text_format="None">
    		<font color="&lt;default&gt;" name="MS Sans Serif" size="8"/>
    		<border color="Black" style="No border" width="1" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
    		<fill color="&lt;default&gt;" accent_color="Winback" style="Solid"/>
    		<shadow style="None"/>
    		<entry name="product-&gt;RE_ORDER" width="4"/>
    		<object name="Reorder" column_title="Reorder" width="0.572916666666667"/>
    	</column>
    </columns>
    </browse>
    %xml%
    
    'Now, display the Xdialog.
    ui_modeless_dlg_box(dlg_title,dlg_body,dlg_event)

  12. #12
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: XML

    or Could you tell me which code is generate the lists?

    http://wiki.alphasoftware.com/New+In+Xdialog+V9

    Under the section heading Embedded Browse on Xdialogs

    Having edited the appearance to your tastes in the Browse editor, you can then get the XML for the browse by selecting Browse, Advanced, Show XML Definition from the Browse Editor menus.

    You should also be able to use
    table.xml_export() and get_from_file()
    Last edited by Stan Mathews; 04-14-2015 at 11:38 AM.
    There can be only one.

  13. #13
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,699

    Default Re: XML

    Hi Stan,
    Interesting use of functions for getting the xml. I assume the UDF to call the browse would generate the xml with the first function to get a current record list and then use the 2nd function here:

    browseObj1_browse_definition = get_from_file(myxmlfile)

    Is that right?

    Geez, this thread is 6 yrs old and I'm still learning how do this stuff!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  14. #14
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: XML

    That's what I was envisioning, haven't tried it.
    There can be only one.

  15. #15
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: XML

    Quote Originally Posted by johnkoh View Post
    How do I make the filtered XML-Browse List before open an xdialog? -
    or Could you tell me which code is generate the lists?
    or Hide the XML-Browse Data until change a variable value?
    John
    What you need to know is described in previous posts here.
    I tried many ways and eventually what I ended with working I looked at the posts here was exactly as described by Tim and Andy in the final post of his.
    Follow the attached screenshots - first shows the piece of code that does it and the others demonstrate this in operation.
    It really is fully dynamic as you wanted.
    My own example is an intrinsic function that will confuse you no end.
    Attached Files Attached Files
    Last edited by Ray in Capetown; 04-20-2015 at 03:33 PM.

Similar Threads

  1. xml request
    By Mr GreenJeans in forum Alpha Five Version 8
    Replies: 3
    Last Post: 09-07-2007, 09:13 AM
  2. Xml
    By Mike Reed in forum Archived Wishlist
    Replies: 9
    Last Post: 12-30-2006, 05:28 PM
  3. Dynamic: tmpl_menu.xml = <<%xml%
    By Sieward in forum Web Application Server v7
    Replies: 5
    Last Post: 02-23-2006, 05:25 AM
  4. XML Anyone
    By Rayr in forum Alpha Five Version 6
    Replies: 0
    Last Post: 10-15-2005, 01:35 PM
  5. XML
    By Anthony Tampone in forum Alpha Five Version 4
    Replies: 12
    Last Post: 04-18-2002, 07:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •