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 Xdialog Tree - How to Refresh After Adding New Record?

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

    Embedded Xdialog Tree - How to Refresh After Adding New Record?

    Hi All,

    Attached is an example that contains a form(RefDocTree_frm) that displays an embedded xdialog tree of the data in the refdocs table. The issue I am having is after adding a new record with the "new record" button on the form containing the tree....the tree does not refresh to show the new branch (or any entry). I have tried on the normal refresh methods (that I know of).

    On the enclosed example open the RefDocTree_frm and add a new record for the year 2010. The new entry will not show until the form has been closed and reopened...thus reinitializing the embedded xdialog tree. I have searched the message board and found one reference by Tim Kiebert but it was for a "normal xdialog tree" and not an embedded one. I can find no info in the help file either as to how to refresh an embedded xdialog tree.

    Any help would surely be appreciated!

    Thanks....

    Jeff

    #2
    Re: Embedded Xdialog Tree - How to Refresh After Adding New Record?

    Bump



    Thanks,

    Jeff

    Comment


      #3
      Re: Embedded Xdialog Tree - How to Refresh After Adding New Record?

      Jeff,
      It took a while but I finally worked it out. Attached is you sample reworked.
      The comments are in the progression of what I did to test.

      First, I moved the xdialog code to a script and set the supercontrol to 'external'. This is just to make it easier to edit.

      Next, I changed the code a bit so it does not use the array. The plain text variable is good enough when working with a tree. It is also much easier to reset the data because you don't have to worry about resizing the array.

      The code to reset the tree data is triggered if a_dlg_button is equal to 'refetch' (an arbitrary name, use what ever you like). I put a button on the xdialog by that name to cause that event. Added a new record and used the button which updated the tree.

      But we don't want to have to press the button to refresh the tree so we need to trigger the event externally some how. This can be done with the function UI_DLG_EVENT(). That function needs to know the title of the xdialog for its first parameter. But we don't know what that is because it gets assigned by the form. I suddenly had a flash of brilliance. Why not ask the xdialog what its title is. That is what the 'test' button does on the xdialog. From this it came to light that the title is made up of the form name and the control name ie :refDocTree_frm:tree_dialog. The 'Check value of dlgtitle' buton on the form is to test that the value we construct is equal to the actual value.

      Knowing this and allowing for the form name to vary accordingly if more than one instance of the form is open we can use
      Code:
      ui_dlg_event(":"+topparent.name()+":Tree_dialog","refetch")
      to trigger the event and refresh the tree.

      We add that line of code to the end of your 'New Record' button and voila.
      Last edited by Tim Kiebert; 10-17-2009, 11:33 PM. Reason: forgot attachment
      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


        #4
        Re: Embedded Xdialog Tree - How to Refresh After Adding New Record?

        The alterations in the previous version only updated the tree's values.

        I made some changes to make the tree be focused on the newly created record and have the form fetch it.

        Changes in:
        New Record button inline xbasic
        Used the ui_dlg_event function to pass in the refuidf of the new record
        re-arranged the dialog event code so a_dlg_button can be manipulated to suit.
        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: Embedded Xdialog Tree - How to Refresh After Adding New Record?

          Tim,

          You are AWESOME!!!! Thank you so much for the time you spent and also your willingness to share your Alpha acumen.

          I can honestly say...I don't think I could have ever figured that one out.

          Thanks again!!!!

          Jeff

          Comment


            #6
            Re: Embedded Xdialog Tree - How to Refresh After Adding New Record?

            Your welcome. :)
            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 Xdialog Tree - How to Refresh After Adding New Record?

              Tim,

              I downloaded sample3 to take a look, but ran into this snag:

              RefDocTree_frm won't open for me; I get a message that the default form will be opened instead.

              When I try design mode for this form, I get an error message:
              Bad Control handle.

              Any idea of what the trouble might be.

              Thanks,
              Bob McGaffic
              Pittsburgh

              Comment


                #8
                Re: Embedded Xdialog Tree - How to Refresh After Adding New Record?

                Hmmm, not really. I just downloaded from the message board into a separate folder and works ok here.

                Have you tried redownloading it?

                The sample was edited in v9 build 2095_3264. Is that what you are using?

                Just tried it in v10 as well and is ok.
                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: Embedded Xdialog Tree - How to Refresh After Adding New Record?

                  Hi,

                  Whenever I change the Date value, my Tree script does not refresh the list. How do you get the refresh the Tree list value?

                  Code:
                  'Create an XDialog dialog box to prompt for parameters.
                  dim shared vDaySch as c
                  DIM SHARED vdate as D '={12/8/10} 'If I set as initial date, the tree listed the my schedule.
                  DIM SHARED vList as C
                  DIM SHARED varC_result as C
                  vFilter= "Assign_date = "+s_quote(Var->vdate)
                  vOrder="lookup(\"emp\",\"emp_id=\"+quote(emp_id),\"alltrim(Emp_fullname)\")"
                  
                  vList = table.external_record_content_get("wrkodr_daily",\
                  "lookup(\"emp\",\"emp_id=\"+quote(Emp_Id),\"alltrim(Emp_fullname)\")+'^'+Assign_date+' '+Wrkodr_Id+' '+Assignment",\
                  vOrder,"Assign_date = "+s_quote(Var->vdate))
                  
                  'vlist =*for_each(treeitem,stritran(treeitem,"^","^"),vlist) 'I do not know what does this script mean and "treeitem" 
                  
                  temp_count = w_count(vList,crlf())
                  DELETE a_vList
                  DIM a_vList[temp_count] as c
                  a_vList.initialize(vList)
                  
                  ok_button_label = "&OK"
                  cancel_button_label = "&Cancel"
                  Delete XdialogStyle
                  dim XDialogStyle as p
                  XDialogStyle.AccentColor = "White"
                  XDialogStyle.Color = "#230+216+142"
                  varC_result = ui_dlg_box("Work Schedule",<<%dlg%
                  {Windowstyle=Gradient Horizontal Middle}
                  {region}
                  date:| [%DATE;P=popup.calendar(dtoc(vdate));I=popup.calendar%.20vdate!vdate_*];
                  DayList:| [%X;S=BLR;D="^"%.80,15vDayList^<vList];
                  {endregion};
                  {line=1,0};
                  {region}
                  <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
                  {endregion};
                  %dlg%,<<%code%
                  if a_dlg_button ="vdate_*" then
                  	vList = table.external_record_content_get("wrkodr_daily",\
                  "lookup(\"emp\",\"emp_id=\"+quote(Emp_Id),\"alltrim(Emp_fullname)\")+'^'+Assign_date+' '+Wrkodr_Id+' '+Assignment",\
                  vOrder,"Assign_date = "+s_quote(Var->vdate))
                      'vlist =*for_each(treeitem,stritran(treeitem,"^"),vlist)
                  	temp_count = w_count(vList,crlf())
                  	DELETE a_vList
                  	DIM a_vList[temp_count] as c
                  	a_vList.initialize(vList)
                  	a_dlg_button = ""
                  end if
                  
                  'if left(a_dlg_button,6) = "vdate_" then 
                  '	if a_dlg_button = "vdate_killfocus" then 
                  '		vdate = ctod(dtoc(vdate))
                  '	end if 
                  '	a_dlg_button = ""
                  'end if
                  %code%)
                  Enclosed the screen shot here. Thank you

                  Comment

                  Working...
                  X