Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

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

Embedded or include with xdialog

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

    Embedded or include with xdialog

    Hello,

    I have the Tree-Menu on left and show the xdialog form on the right side layout. I want to open the xDialog form when changed the Menu selection.
    I have tried
    (1) {condition} ... condition 1, condition 2, condition nth .... {condition=.t.} command which is work well but Problem is I have to write for too many conditions.

    (2) {include =.... } and {embedded = ... } with UDF which is this sample code. I'd like to use this function but It did not fire, refresh, show with a proper xdialog whenever changed the Tree.

    (3) {include =.... } and {embedded = ... } with String-dialog( dlg_basic=<<%dlg% ..... %dlg% .... ). - same problem, not worked

    Code:
    tree_data = <<%a%
    +3Users and Groups.1+2Basic
    +3Users and Groups.1+2Child
    +3Report.1+2Report one
    +3Report.1+2Report two
    %a%
    
    tree_images = <<%a%
    $a5_folder
    $a5_folder_open
    user_object16x16_0
    %a%
    
    dim vDynamicTitle as c= ""
    vDynamicTitle ="basicDlg"
    'vDynamicTitle ="ChildDlg"
    
    vDynamicTitle =eval("vDynamicTitle")
    
    '
    'structure 
    dim vdlg as c =""
    
    vSelect="Users and Groups.Basic"
    
    vdlg = <<%dlg%
    {startup=init}
    {watch=vSelect!vTree_changed}
    
    
    {Font = Arial,8,""}
    
    {region=L}
    [%S=LX;I=@tree_images%.30,20vSelect^<tree_data]
    {endregion}|
    
    
    {region=R}
    Which:|;
    
    [SIZE=4][COLOR="#0000FF"]__dlgname__; [/COLOR][/SIZE]
    
    
    {endregion};
    
    
    {line=2,2;
    {region}
    <*15&OK!OK> <15&Cancel!CANCEL>
    {endregion};
    %dlg%
    
    dlg_event=<<%code%
    if a_dlg_button = "init" then
        a_dlg_button = ""
        
        Show_BasicList(local_variables())   'and {embedded=0,0:basicList};  it works
        'show_embedded(local_variables())
        vDynamicTitle =eval( "vDynamicTitle" )
        'vdlg = stritran(vdlg,"__dlgname__","{include="+ var->vDynamicTitle +"}")
        
    end if
    
    If a_dlg_button ="vTree_changed" then
        vDynamicTitle =""
        If vSelect="Users and Groups.Child" then
            show_embedded(local_variables())
            vDynamicTitle ="ChildDlg"
            'vdlg = stritran(vdlg,"__dlgname__","{include=dlgchild}")
        else If vSelect="Users and Groups.Basic"
        	Show_BasicList(local_variables())
        	vDynamicTitle ="BasicDlg"    
        	'vdlg = stritran(vdlg,"__dlgname__","{include=dlgList}")
        else
        	msgbox("selected other")	
        end if
        msgbox("tree value ",vDynamicTitle)
        vDynamicTitle = eval("vDynamicTitle")
    
        vdlg =""
       [COLOR="#FF0000"] vdlg = stritran(vdlg,"__dlgname__","{embedded=0,0:"+ var->vDynamicTitle +"}")[/COLOR]
        ui_dlg_refresh("Tree List and form")
    
        [COLOR="#FF0000"][SIZE=5]showvar(vdlg,"test when tree changed ")[/SIZE][/COLOR]   '[COLOR="#FF0000"]It showed blank result.  Problem at here.[/COLOR]
    
         a_dlg_button =""
    end if
    
    %code%
    
    
    'vdlg = stritran(vdlg,"__dlgname__","{include="+ var->vDynamicTitle +"}")
    
    vdlg = stritran(vdlg,"__dlgname__","{embedded=0,0:"+ var->vDynamicTitle +"}")
    
    showvar(vdlg,"test just code ")
    
    
    varC_result = ui_dlg_box("Tree List and form",vdlg,dlg_event)
    
    Function Show_BasicList as c (vars as p)
    	with vars
    data = <<%a%
    Row 1 Column 1{T=$1}Row 1 Column 2{T=$2}Row 1 Column 3
    Row 2 Column 1{T=$1}Row 2 Column 2{T=$2}Row 2 Column 3
    Row 3 Column 1{T=$1}Row 3 Column 2{T=$2}Row 3 Column 3
    Row 4 Column 1{T=$1}Row 4 Column 2{T=$2}Row 4 Column 3
    Row 5 Column 1{T=$1}Row 5 Column 2{T=$2}Row 5 Column 3
    Row 6 Column 1{T=$1}Row 6 Column 2{T=$2}Row 6 Column 3
    %a%
    
    vDynamicTitle =	"BasicDlg"
    ui_Modeless_dlg_box(vDynamicTitle,<<%dlg%	
    {watch=ui_dlg_control_anchor_from_pos(dlg_title)!resize}
    <%O={@@};B=ILG;F=fmt%100=fmt!click>;
    [%O={@@};F=fmt;R;%.100,18item^#data]	
    %dlg%)
    
    	end with
    end function
    
    function show_embedded as v (vars as P)
        with vars
    vDynamicTitle ="ChildDlg"    
    ui_modeless_dlg_box(vDynamicTitle,<<%dlg%
    {wrap=40}
    This is an embedded dialog box that responds to the Hello event sent to it from its parent.;
    {lf};
    Name: [.20name];
    {lf};
    Enter a name into the Name field and click this button. After 2 seconds, the "Hello" dialog box will appear.;
    {lf};
    <Hello>;
    %dlg%,<<%code%
    if a_dlg_button = "Hello" then
        'sleep(2)
        ui_msg_box("","Hello: " + name)
        ui_modeless_dlg_close("childDlg")
    end if
    %code%)
    end with
    end function
    Does anyone know what did I missing on this code? or It is not suitable with Tree.

    #2
    Re: Embedded or include with xdialog

    Have you seen the Toolbox in AS? It creates a dockable custom toolbar. You can have an animated or a tree display.
    Robin

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

    Comment


      #3
      Re: Embedded or include with xdialog

      Robin,

      The ToolBox is not available from Version 9.

      I think I am missing several new features.

      Thank you.

      Comment


        #4
        Re: Embedded or include with xdialog

        You can create a custom stand alone toolbar in v9 that can be docked on the right with buttons that open menus that offer more choices. Not what you were looking for, but probably easier to design...
        Robin

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

        Comment


          #5
          Re: Embedded or include with xdialog

          Robin,

          I worked with other "Embedded " functions.

          While I tried with "{beginembedded}", I just found that typical embedded is allowed only dialog "FRAME" , not entire " box " value.


          You can create a custom stand alone toolbar in v9 that can be docked on the right with buttons that open menus that offer more choices.
          Is this edit_system_tool.jpg what you referred?


          Thank you.

          Comment


            #6
            Re: Embedded or include with xdialog

            John,
            Using embedded xdialogs can work well once you get the hang of it. The main idea to grasp is that you set up an embedded dialog within the parent xdialog using one title per embedded xdialog. So rather than creating multiple xdialogs and changing the title in the embedded control you instead create multiple definitions of the same xdialog and then rerun that xdialog with which ever definition you need at the time. This is demonstrated in the Learning XDialog app chapter 17(the genie version) in the main Alpha program folder . The parent will know that the xdialog with that name will be placed in the embedded area.

            Having said that I am not saying it is not possible to use the other approach of changing xdialog titles but that requires you to rerun/refresh the parent xdialog which may have unwanted side affects.

            Below I have changed your sample to demonstrate this. Besides the xdialog there are two functions. One to define the xdialogs for each choice and the other to handle the choice and turn it into a value corresponding to the the variable name that holds the appropriate xdialog definition.

            The definitions of the various xdialogs and putting them into variables does not have to happen in a function. You could just do that at the start of the script before the xdialog runs in place of the function call. But I think it is good practice to isolate some of these jobs into functions. In one application I use this function to dynamically build the definition according to the data being presented. So each variable contains the complete code (including the Xdialog function) to run the xdialog which is then passed into 'evaluate_template' when needed. I usually build each xdialog in a new script so it can be tested separately and you can make use of the auto complete. Then cut and paste it into the main function. The naming of the variables is arbitrary but I combined the name of the xdialog with choice from the menu so the variable to use can be dynamically provided. This also allows for multiple embedded xdialogs.

            The 'FixChoice' function takes the value from vSelect(the tree choice) and isolates the last part (using the word function) which is the actual choice. Then substitutes the underscore for any spaces, because the variables names cannot have spaces. And finally concatenate it to the name of the embedded xdialog. Next we check if there is actually a variable of that name. if there is then we pass that out as the result.

            Hopefully this will give you some ideas and get you to the next step.
            Attached Files
            Last edited by Tim Kiebert; 11-10-2014, 10:12 PM.
            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


              #7
              Re: Embedded or include with xdialog

              Tim,

              WORK PRETTY WELL THANK YOU

              I want to say LOUDER
              Last edited by johnkoh; 11-12-2014, 09:09 AM. Reason: spelling

              Comment


                #8
                Re: Embedded or include with xdialog

                Hi Tim,

                Basic Question - How does the Parent xdialog communicate with the child "Embedded" xdialog?

                I understood about How the "Genie" style embedded xdialog works.

                I started a new xdialog form and it has the three List-Boxes on left side and one child embedded List-Box.
                My Goal is whenever the Left side List-Boxes is changed then refresh and show the data on right side List-Box.
                My Left-side Boxes filters code which control the data are working fine because
                (1) shows the xdialog - both side
                (1) I can see the table's data with testing msgbox().
                (2) It shows the number of line as I designed

                but my problem is that the filtered data is not displayed or changed on the child xdialog even I can see the Data with Testing.
                It is showing the "Initial" records only.

                Comment


                  #9
                  Re: Embedded or include with xdialog

                  John,
                  The parent doesn't really communicate with the embeded xdialog. It basically reruns the the code that defines that embedded xdialog. So if you want something to change in that embedded xdialog (including having different data show in it) then you have to dynamically rewrite that definition and then rerun that definition. Without knowing the mechanisms you are using to display the data in the embedded xdialog I can not offer any more advice than that.
                  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


                    #10
                    Re: Embedded or include with xdialog

                    Tim,

                    So if you want something to change in that embedded xdialog (including having different data show in it) then you have to dynamically rewrite that definition and then rerun that definition.
                    Thank you for this clarification and will let you know the result.

                    Comment

                    Working...
                    X