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

XD Tree Supercontrol & Layout Variables

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

    XD Tree Supercontrol & Layout Variables

    I am trying to filter my form and have the xd tree updated with the same filter. The tree is based on the data in the same table. I am using a shared variable in a dropdown object to change the global variable that is used in the filters. I created the script first for testing from the IW and it behaved as expected and have tried using it both as the local and as the external script for the supercontrol. However...the errors I am getting have to do with the %code% section when I refer to either one of these variables in the event handler section. Both variables are dimmed in the script.

    'if a_dlg_button = myevent then
    if my_global_var <> " " then 'this throws the error 'my_global_var not found'
    'code to refetch the tree data, etc.

    Is there some reason I am not aware of that this tactic is a no-no for a supercontrol?
    Robin

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

    #2
    Re: XD Tree Supercontrol &amp; Layout Variables

    Here is my edited local script for the supercontrol. The tree data is based on the same table as the form. This one at least will display. But the change event says the vTree
    variable is not found!

    I cannot seem to find my error...

    Code:
    DIM global chk_app as c
    dim shared lu_app as c = chk_app
    dim shared flter as c = ""
    DIM shared vTree as C
    DIM shared vChoice as C
    dim shared vTreeData as c
    dim tbl as p
    tbl = table.current()
    if chk_app <> "" then
        flter = "app="+quote(var->chk_app)
    	vTreeData = tbl.record_content_get("alltrim(Chapter)+\".\"+alltrim(Topic)+\".\"+'{Data='+alltrim(Helpid)+'}'+alltrim(Help_ref)","sortkey",flter)
    else
    	vTreeData = tbl.record_content_get("alltrim(Chapter)+\".\"+alltrim(Topic)+\".\"+'{Data='+alltrim(Helpid)+'}'+alltrim(Help_ref)","sortkey","")
    end if
    
    'NOTE: don't need this option to add the 'z' to test the return data for vChoice is Helpid - see below
    'vTreeData = tbl.record_content_get("alltrim(Chapter)+\".\"+alltrim(Topic)+\".\"+'{Data=z'+alltrim(Helpid)+'}'+alltrim(Help_ref)","sortkey","")
    
    'in case Topic is blank omits level 2
    vTreeData = *for_each(foo,stritran(foo,"..","."),vTreeData)
    ui_modeless_dlg_box(dlgTitle,<<%dlg%
    {comment}
    {background=<Transparent>}
    {watch=lu_app!lu_cx}
    {region}
    {font=Comic Sans MS,12};
    Table of Contents;
    {Endregion};
    {Region}
    {font=Arial,10}
    [%S=BRL%.40,30vTree^<vTreeData!ev_*];
    {Endregion}; 
    {Region}
    Selection: [.27vChoice]
    {Endregion};
    {justify=Left};
    {lf};
    <*12Refresh!redo>;
    {endregion};
    %dlg%,<<%code%
    if a_dlg_button = "redo" .or. a_dlg_button = "lu_cx" then
       	flter = "app="+quote(var->chk_app)
    	vTreeData = tbl.record_content_get("alltrim(Chapter)+\".\"+alltrim(Topic)+\".\"+'{Data='+alltrim(Helpid)+'}'+alltrim(Help_ref)","sortkey",flter)
     	vTreeData = *for_each(foo,stritran(foo,"..","."),vTreeData)
    end if 	
    
    if a_dlg_button = "ev_change" .or. a_dlg_button = "ev_dblclick"
    	'test that the return value is the Helpid data when Help_ref is selected
    	[COLOR="#FF0000"]if left(vTree,2) = "H0" then[/COLOR]	  	
                              vChoice = alltrim(vTree)	  	'  		 	
    	else 
    		'shows that no action will take place at the upper group levels
    		vChoice = ""  	  		  	 
    	end if
    end if
    %code%)
    if vChoice <> "" then
        topparent.find(vChoice)
    end if
    'NOTE: could not test for lu_app value in the code section.
    'I even tried adding radio buttons to change these vars in the dlg_body and attached events to them but it would
    'not work once the tree was embedded in a form as a supercontrol
    Robin

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

    Comment


      #3
      Re: XD Tree Supercontrol &amp; Layout Variables

      I see no one is finding this a very interesting topic (yet?). But in trying to resolve this, I have been playing with the regular tree control object and was able to include this with my vTreeData = tbl.record_content_get() string:

      ("alltrim(Chapter)+\".\"+alltrim(Topic)+\".\"+alltrim(Help_ref) +\"|\"+alltrim(helpid) ","sortkey",flter)

      This allows me a 3 level display that returns the Helpid value to find without having to display a 4th level for the user to click.

      Also in looking at creating choices for list box controls where this 'Label|Value' format is used, the list box genie also shows how to add a bitmap - which the tree control genie doesn't include. However the same properties seem to be available in the object explorer for the tree - which if I could just figure that out, I could forget about the XD supercontrol that won't work!

      I am able to get the tree to refresh when my variable changes by using the same dynamic.settings I used to populate the tree in the form's OnInit event.

      If anyone shows some interest, maybe I can put up a working example.
      Last edited by MoGrace; 04-10-2013, 02:39 AM.
      Robin

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

      Comment


        #4
        Re: XD Tree Supercontrol &amp; Layout Variables

        I see no one is finding this a very interesting topic
        If anyone shows some interest, maybe I can put up a working example.
        With complex code, absence of interest tends to have a relationship with absence of base tables to "watch it work" and scout out your need.
        I looked at it for a couple minutes. Without the "current" table, hard to capture the action, sorry.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #5
          Re: XD Tree Supercontrol &amp; Layout Variables

          Ok fair enough, but it ain't working too good yet... to get to the control panel the password if asked is 'a5', otherwise CTRL+Z will get you there from the Home form. The Help Tree form is working so far, but the XD_Help Tree is not.

          Just to note that the point of this exercise (in futility?) is to have a 'global' module I can use with other apps. Right now only MenuTree, NStock and PRdata are valid choices. And don't expect the Action Menu to work in any of them except MenuTree. I did add bubble help...and some global functions that are used in the Design Bar when it opens so you can use it.
          Attached Files
          Last edited by MoGrace; 04-16-2013, 11:52 PM.
          Robin

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

          Comment


            #6
            Re: XD Tree Supercontrol &amp; Layout Variables

            I see lack of interest didn't improve even when I added the zip...
            Robin

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

            Comment


              #7
              Re: XD Tree Supercontrol &amp; Layout Variables

              Hi Robin,

              Take a look at this thread. It may help. Tim Kiebert graciously figured this out for me quite awhile back on something I was working on t the time. But, perhaps the refetch method he provided might help you. I only briefly looked at your sample. Great idea. I have also thought of doing something similar using the framework I have built over the years along with the dynamic menu tree system I provided in the code archive awhile back as well. I like your approach and the appearance of your docked toolbar approach.

              http://msgboard.alphasoftware.com/al...highlight=tree

              Regards,

              Jeff

              Comment


                #8
                Re: XD Tree Supercontrol &amp; Layout Variables

                Robin,
                Using the sample you posted you are almost there.

                Change the scope of the lu_app variable in the xdialog script to local. ie remove the word 'shared'. ( I would probably change the name of this var or the form var to be different but it seems to work even though they are the same.)

                In the embedded xdialog super control go to the variable bindings tab. create a new binding between the lu_app var in the code and the lu_app var in the form.

                This will link the form var to the xdialog var. Then the watch that you have already set up will see the change happening in the local variable.

                That should be it.

                Tim
                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: XD Tree Supercontrol &amp; Layout Variables

                  Hi Tim,
                  I will definitely give that a try. I thought of doing the variable binding thing but was not sure how to do it.
                  Robin

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

                  Comment


                    #10
                    Re: XD Tree Supercontrol &amp; Layout Variables

                    Tim,
                    So far I have tried moving the variable lookup box (lu_app) into the XD tree script instead of on the form and that seems to work fine for refreshing the tree. What I can't seem to get to work consistently is the resynch of the parentform to display the new data in the filtered index that uses the global var->chk_app. I tried placing the global variable as an object on the form which the XD script changes accurately but leaves the form in change mode; however the change event for that object is not happening - which is where I thought commiting the change and refreshing the form might work. Any ideas on that?

                    Also if adding a new record and using ui_dlg_event() in the button script will refresh the Tree - where else might I put that function to test my 'lu_change' event when it occurs in the tree? Do I arbitrarily add an event in the code section that is unrelated to events in the tree objects? Because once you remove the 'refresh' button - it doesn't seem that there would be a 'refresh' event...any more.

                    edit:
                    Does the form script actually trigger the event?

                    if ui_dlg_event(":"+topparent.name()+":tree_dialog","lu_change")
                    a_dlg_button = "refresh"
                    ...some script to refresh the form here..OR
                    runs the script in the XD?
                    end if
                    Last edited by MoGrace; 05-13-2013, 04:25 PM.
                    Robin

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

                    Comment

                    Working...
                    X