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

Xdialog Tree Control - Auto expand entry

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

    Xdialog Tree Control - Auto expand entry

    I am experimenting with the Xdialog Tree Control and wish to have an entry auto expanded upon initialization.

    Currently I am able to specify the default choice and have it auto selected but I cannot figure out how to expand it. I have found a thread that suggested using a send key function to expand the entries. However I do not know how to execute the commands after I have generated the Xdialog.

    Any help would be appreciated. I have attached a scaled down version of the database along with a picture of what I would like to see when the Xdialog is initially opened.
    Attached Files
    Andrew

    #2
    Re: Xdialog Tree Control - Auto expand entry

    Hi Andrew,

    I have toyed a bit with your sample code.
    Unfortunately, it seems that the xD Tree Control is solely 'user driven' meaning that there seems to be no way to 'navigate' to a specific node and open it by code.
    All I know is the $S=X directive but this opens all nodes (what you probably already knew and tried) and which took almost 20 secs with the 7000 odd records you got.

    Sorry for not being any help here
    SwissCharles
    Between the Alps and a comfy place

    Comment


      #3
      Re: Xdialog Tree Control - Auto expand entry

      You helped by confirming the same findings I found.
      Andrew

      Comment


        #4
        Re: Xdialog Tree Control - Auto expand entry

        It is doable, easily..I will post a sample given a little bit of time..stay tuned.

        Comment


          #5
          Re: Xdialog Tree Control - Auto expand entry

          Originally posted by G Gabriel View Post
          It is doable, easily..I will post a sample given a little bit of time..stay tuned.
          same Bat-time, same Bat-channel?
          Andrew

          Comment


            #6
            Re: Xdialog Tree Control - Auto expand entry

            ? Sunday eve?
            I just opened your sample. If you wish to speed things up a bit, can you take out the functions, the curly parenthesis, make a simple form with a simple bare-bone xdlg with the desired tree?. I should be able to modify that to do what you want then you could fancy it up later rather than me trying to gut out your form and rebuild it.

            Comment


              #7
              Re: Xdialog Tree Control - Auto expand entry

              Will this work?

              Code:
              'Date Created: 13-Jun-2002 07:56:43 AM
              'Last Updated: 06-Sep-2012 08:20:50 AM
              'Created By  : Selwyn
              'Updated By  : andy
              dim data[10] as c
              data[1] = "a.1.A"
              data[2] = "a.1.B"
              data[3] = "a.2.A"
              data[4] = "a.2.B"
              data[5] = "b.1.A"
              data[6] = "b.1.B"
              data[7] = "b.2.A"
              data[8] = "b.2.B"
              
              result=ui_dlg_box("Simple Tree",<<%dlg%
              {ysize=2}
              [%S=BLR%.50,20node^<data] |
               <OK>
              %dlg% )
              Andrew

              Comment


                #8
                Re: Xdialog Tree Control - Auto expand entry

                When I said bare-bone I didn't mean Play-Boy-style "bare" bone!
                You way over-simplified it, but use this as a start:

                Code:
                dim node as c
                node="a.2.B"
                dim data[10] as c
                data[1] = "a.1.A"
                data[2] = "a.1.B"
                data[3] = "a.2.A"
                data[4] = "a.2.B"
                data[5] = "b.1.A"
                data[6] = "b.1.B"
                data[7] = "b.2.A"
                data[8] = "b.2.B"
                
                result=ui_dlg_box("Simple Tree",<<%dlg%
                {ysize=2}
                [%S=BLR%.50,20node^<data] |
                 <OK>
                %dlg% )
                This: node="a.2.B" will be dynamically set.

                Comment


                  #9
                  Re: Xdialog Tree Control - Auto expand entry

                  Setting node to "a.2.B" only works when the lists are predefined prior to generation. However when using the X directive to have the lists generated dynamically it does not work.

                  The dynamic list generation is what all the functions and curly brackets where doing.
                  Andrew

                  Comment


                    #10
                    Re: Xdialog Tree Control - Auto expand entry

                    Let's not get into the egg & chicken.
                    "a.2.B" is one of the items in the list "to be generated"
                    When you click on a row in the browse, the node value, i.e. "a.2.B" will be assigned at that point, then you open your xdlg.
                    If I recall, in your sample you have 190.2 or something like that. I believe it came from either the browse or some query. That is the value you assign to the node.

                    Comment


                      #11
                      Re: Xdialog Tree Control - Auto expand entry

                      Ya, tried that already. Does not work I assume it does not work because the node does not exist until it is expanded by clicking the "+" symbol.
                      Andrew

                      Comment


                        #12
                        Re: Xdialog Tree Control - Auto expand entry

                        Andrew:
                        I have been using trees since the ice age and they work just fine for me. It takes me exactly where I want to go. I guess I am going to have to wade through your code, not today, and modify it. I was hoping instead of this example you posted lately, to post your actual table without all the additives so I don't have to spend as much time connecting the dots. It would be helpful if you could do that. A form, showing which item you want the tree to open to or expand to and an xdlg, that's all.

                        Comment


                          #13
                          Re: Xdialog Tree Control - Auto expand entry

                          Gabe -

                          Thank you for your time and looking at this for me.
                          Let me know if this will work for you.
                          Attached Files
                          Andrew

                          Comment


                            #14
                            Re: Xdialog Tree Control - Auto expand entry

                            Andy:
                            Next time I am going to [Be very annoyed - edited by moderator]!
                            Pay attention to what I am saying. It took exactly 2 seconds to fix your script.
                            There is a lot of fluff that you do not need. I understand the purpose of the curly brackets..I wrote the book on this crap! But you don't need it in this context.
                            I modified your "TreeGabe" script to this:

                            Code:
                            'Date Created: 04-Sep-2012 03:33:38 PM
                            'Last Updated: 07-Sep-2012 05:24:55 AM
                            'Created By  : andy
                            'Updated By  : Gameel
                            
                            OPTION STRICT
                            OPTION ENCRYPTED_TOKENS
                            ON ERROR GOTO ERR_HANDLER
                            
                            DIM vPtNoN as n
                            DIM vGuarN as N
                            vPtNoN=Ptno.value
                            vGuarN = topparent:Guar.value
                            
                            DIM vFilterC as C
                            DIM vOrderC as C
                            DIM vContentC as C
                            DIM vTablenameC as C
                            vTablenameC = "Dep"
                            vContentC = "Guar+'^'+Ptno"
                            vFilterC = "Guar<>0"
                            vOrderC = "Guar"
                            
                            DIM vTreeListC as C
                            dim vSelectedC as C
                            vTreeListC = table.external_record_content_get(vTablenameC,vContentC,vOrderC,vFilterC)
                            DIM vSelectedC as C
                            vSelectedC = ""+vGuarN + "^" + vPtNoN
                            
                            '---Begin DO NOT INDENT---				
                            ui_dlg_box("Balance Artrans",<<%dlg%
                            [%X;S=BLR;D="^"%.50,20vSelectedC^<vTreeListC];
                            [.15vselectedc];
                            {justify=right}
                            <10&OK!ok> <Cancel!Cancel>;
                            %dlg%)
                            '---End DO NOT INDENT---
                            	
                            END
                            '-----------------------------------
                            'Error handler
                            '-----------------------------------
                            ERR_HANDLER:
                            	DIM vErrN as N 
                            	DIM vMsgC as C
                            	vErrN = error_code_get()
                            
                            	vMsgC = "Error # "+ vErrN + crlf() + error_text_get(vErrN)
                            	vMsgC = vMsgC + crlf() + "Script: " + error_script_get()
                            	vMsgC = vMsgC + crlf() + "Line #: " + error_line_number_get()
                            
                            	trace.writeln(vMsgC)
                            
                            	ui_msg_box("Error", vMsgC,UI_ATTENTION_SYMBOL)
                            	vMsgC = ""
                            	
                            	END
                            Works just fine. Does what you want.
                            Last edited by Dave McCormick; 09-07-2012, 09:26 AM. Reason: Needed to be toned down

                            Comment


                              #15
                              Re: Xdialog Tree Control - Auto expand entry

                              Gabe -

                              Thank you for the help, no need for the threats.
                              Andrew

                              Comment

                              Working...
                              X