Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

XML

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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, 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.

    Comment


    • #3
      Re: XML

      Hi Tim

      Works great

      Thankyou

      Andy

      Comment


      • #4
        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.

        Comment


        • #5
          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.

          Comment


          • #6
            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

            Comment


            • #7
              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

              Comment


              • #8
                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.

                Comment


                • #9
                  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

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      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)

                      Comment


                      • #12
                        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, 10:38 AM.
                        There can be only one.

                        Comment


                        • #13
                          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

                          Comment


                          • #14
                            Re: XML

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

                            Comment


                            • #15
                              Re: XML

                              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
                              Last edited by Ray in Capetown; 04-20-2015, 02:33 PM.

                              Comment

                              Working...
                              X