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

Need help with Drop-Down Tree Control

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

    Need help with Drop-Down Tree Control

    What I would like to do is create a Drop-Down Tree Control and have the final selection allow me to open a PDF.

    The PDF's will be stored in a directory....i.e. C:\PDFs\Public (directory structure is just an example). The tree will be 3 levels deep (see below).

    Goal.....
    Create a Drop-Down tree control that allows me to select the Type of Meeting, Year and then the month.

    The CRLF structure would look something like this...

    Employee Summaries.2010.January
    Employee Summaries.2010.February
    Employee Summaries.2010.March
    Employee Summaries.2011.January
    Employee Summaries.2011.February
    Employee Summaries.2011.March
    Management Minutes.2010.January
    Management Minutes.2010.February
    Management Minutes.2010.March
    Management Minutes.2011.January
    Management Minutes.2011.February
    Management Minutes.2011.March

    When viewing the drop down, it should look something like this (without the underscores)...

    Employee Summaries
    ___2010
    ______January
    ______February
    ______March
    ___2011
    ______January
    ______February
    ______March

    Management Minutes
    ___2010
    ______January
    ______February
    ______March
    ___2011
    ______January
    ______February
    ______March


    My questions...
    1. Is it be best to build the CRLF list from a table? If yes, is the best way to get the table information into a CRLF list by using table.External_Record_Content_Get?

    2. If using a table is it best to separate the levels?
    Fields = Level1, Level2 and Level3

    3. How do I link the PDF to the particular selected record? PDFs would be stored in single directory and names something like 2010_January.pdf, 2010_February.pdf, etc.

    If someone would go as far as creating an example, that would be fantastic although I will take anything anyone has to offer.

    #2
    Re: Need help with Drop-Down Tree Control

    Here is your sample menu:
    Code:
    vMenuItems = <<%a%
    Employee Summaries|2010|January
    Employee Summaries|2010|February
    Employee Summaries|2010|March
    Employee Summaries|2011|January
    Employee Summaries|2011|February
    Employee Summaries|2011|March
    Management Minutes|2010|January
    Management Minutes|2010|February
    Management Minutes|2010|March
    Management Minutes|2011|January
    Management Minutes|2011|February
    Management Minutes|2011|March
    -
    Cancel
    %a%
    
    vChoice = ui_popup_menu(vMenuItems)
    IF vChoice = "Cancel" .OR. vChoice = ""
        END
    END IF

    1. Is it be best to build the CRLF list from a table? If yes, is the best way to get the table information into a CRLF list by using table.External_Record_Content_Get?

    Sure, why not.

    2. If using a table is it best to separate the levels?
    Fields = Level1, Level2 and Level3


    You can do that or use one field with a delimiter. Ui_popup_menu wants a |

    3. How do I link the PDF to the particular selected record? PDFs would be stored in single directory and names something like 2010_January.pdf, 2010_February.pdf, etc.

    Not exactly sure what you want to do here, but it's doable.
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com


    Comment


      #3
      Re: Need help with Drop-Down Tree Control

      Peter, Excellent thanks. This is not exactely what I was thinking of but actually might just work out better :)

      In my last question, if I were to literally select one of the item's in the list I need it to open the corresponding PDF file.

      For example, if I select--> Employee Summaries|2010|January (By clicking on it in the list) When I click on it I need it to open C:\PDFs\Public\2010_January.PDF

      Does that make sense?

      Comment


        #4
        Re: Need help with Drop-Down Tree Control

        Example.
        There can be only one.

        Comment


          #5
          Re: Need help with Drop-Down Tree Control

          Stan is so fast that you need a strobe light to catch him in action!
          Peter
          AlphaBase Solutions, LLC

          [email protected]
          https://www.alphabasesolutions.com


          Comment


            #6
            Re: Need help with Drop-Down Tree Control

            FYI: If you want to use the ui_popup_menu, you would probably need to modify the code something like this:

            Employee Summaries|2010|{data=Employee Summaries,2010,January}January
            etc
            etc


            The {data=something}choice line allows you to get an explicit value rather than just the generic month.
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #7
              Re: Need help with Drop-Down Tree Control

              Try this.

              Code:
              dim vMenuItems as C
              vMenuItems = <<%a%
              Employee Summaries|2010|January
              Employee Summaries|2010|February
              Employee Summaries|2010|March
              Employee Summaries|2011|January
              Employee Summaries|2011|February
              Employee Summaries|2011|March
              Management Minutes|2010|January
              Management Minutes|2010|February
              Management Minutes|2010|March
              Management Minutes|2011|January
              Management Minutes|2011|February
              Management Minutes|2011|March
              %a%
              
              
              dim images as C
              images = "a5_folder"+crlf()+"$$code.script"
              
              dim vLtree as c
              for each foo in vmenuitems
              	vLA=word(foo,1,"|")
              	vLB="Year_"+word(foo,2,"|")
              	vLC=word(foo,3,"|")
              
              	vLtree=vLtree+"1+1"+alltrim(vLA)+".1"+alltrim(vLB)+".2"+alltrim(vLC)+crlf()
              next
              
              
              ui_modeless_dlg_box("FOLDERS",<<%dlg%
              {font=arial,10}{justify=right}<Fetch>;
              {justify=Center}{font=arial,10}{position=1,1.31}{nocaption}{background=black}{xmargin=4,4}{ymargin=2,1}
              [%S=BLR;I=@images%.85,30vitem_selected^<vLtree!menuitem_change];
              <close>
              %dlg%,<<%code%
              IF a_dlg_button="Close"
              	ui_modeless_dlg_close("FOLDERS")
              END IF
              
              IF a_dlg_button="fetch"
              	'msgbox(vitem_selected)
              	dim vfile_path as C
              	dim vR as N
              	vfilepath="C:\PDFs"+chr(92)+"Public"+chr(92)+alltrim(substr(word(vitem_selected,2,"."),6,4))+"_"+alltrim(word(vitem_selected,3,"."))+".pdf"
              	vR=msgbox("Confirmation","Open "+vfilepath+" ?   ",65)
              	if vR=1
              		sys_open(vfilepath)	
              	else
              		end
              	end if
              	
              END IF
              
              'IF a_dlg_button="menuitem_change"
              '	msgbox(Vitem_selected)
              'end if
              %code%)
              Mike W
              __________________________
              "I rebel in at least small things to express to the world that I have not completely surrendered"

              Comment


                #8
                Re: Need help with Drop-Down Tree Control

                Peter/Stan/Mike,

                Thanks for all the instruction/feedback and ideas!! It definetly got me what I needed.

                The attached zip file contains a couple of test PDFs for those of you that would like to see how this example works

                To see this example in action perform the following.

                1. Extract Zip file and place the PDFs folder on the root of the C: drive (C:\PDFs)

                2. Place the code below on the OnPush event of a button

                DIM SHARED PDF_Path as C
                PDF_Path = "C:\PDFs\\"

                vMenuItems = <<%a%
                {I=$$folder}Employee Meeting|{I=$$folder}2010|{DATA=2010\january.pdf}{I=$$application.adobe.pdf}January
                {I=$$folder}Employee Meeting|{I=$$folder}2010|{DATA=2010\February.pdf}{I=$$application.adobe.pdf}February
                {I=$$folder}Employee Meeting|{I=$$folder}2010|{DATA=2010\March.pdf}{I=$$application.adobe.pdf}March
                {I=$$folder}Employee Meeting|{I=$$folder}2011|{DATA=2011\january.pdf}{I=$$application.adobe.pdf}January
                {I=$$folder}Employee Meeting|{I=$$folder}2011|{DATA=2011\February.pdf}{I=$$application.adobe.pdf}February
                {I=$$folder}Employee Meeting|{I=$$folder}2011|{DATA=2011\March.pdf}{I=$$application.adobe.pdf}March
                %a%

                vChoice = ui_popup_menu(vMenuItems)
                IF vChoice = "Cancel" .OR. vChoice = ""
                END
                END IF

                sys_open(PDF_Path+vChoice)

                Comment


                  #9
                  Re: Need help with Drop-Down Tree Control

                  Nice job Scott!
                  Peter
                  AlphaBase Solutions, LLC

                  [email protected]
                  https://www.alphabasesolutions.com


                  Comment


                    #10
                    Re: Need help with Drop-Down Tree Control

                    You should be able to auto-populate the list from a table. (Example using my sample table)

                    Code:
                    t1 = table.external_record_content_get("base","alltrim(Type) + \"|\" + alltrim(C_Yr) + \"|\" + alltrim(Mn)","Type+c_yr+padl(alltrim(str(month_number(Mn))),2,\"0\")")
                    
                    ? t1
                    = Employee Summaries|2010|January
                    Employee Summaries|2010|February
                    Employee Summaries|2010|March
                    Employee Summaries|2010|April
                    Employee Summaries|2010|May
                    Employee Summaries|2010|June
                    Employee Summaries|2010|July
                    Employee Summaries|2010|August
                    Employee Summaries|2010|September
                    Employee Summaries|2010|October
                    Employee Summaries|2010|November
                    Employee Summaries|2010|December
                    Employee Summaries|2011|January
                    Employee Summaries|2011|February
                    Employee Summaries|2011|March
                    Employee Summaries|2011|April
                    Employee Summaries|2011|May
                    Employee Summaries|2011|June
                    Employee Summaries|2011|July
                    Employee Summaries|2011|August
                    Employee Summaries|2011|September
                    Employee Summaries|2011|October
                    Employee Summaries|2011|November
                    Employee Summaries|2011|December
                    
                    
                    t2done = *for_each(foo,"{I=$$folder}"+word(word(t1,*COUNTER(),crlf()),1,"|")+"|"+"{I=$$folder}"+word(word(t1,*COUNTER(),crlf()),2,"|")+"|"+"{DATA="+word(word(t1,1,crlf()),2,"|")+"\\"+word(word(t1,*COUNTER(),crlf()),3,"|")+".pdf"+"}{I=$$application.adobe.pdf}"+word(word(t1,*COUNTER(),crlf()),3,"|"),t1)
                    ? T2DONE
                    = {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\January.pdf}{I=$$application.adobe.pdf}January
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\February.pdf}{I=$$application.adobe.pdf}February
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\March.pdf}{I=$$application.adobe.pdf}March
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\April.pdf}{I=$$application.adobe.pdf}April
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\May.pdf}{I=$$application.adobe.pdf}May
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\June.pdf}{I=$$application.adobe.pdf}June
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\July.pdf}{I=$$application.adobe.pdf}July
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\August.pdf}{I=$$application.adobe.pdf}August
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\September.pdf}{I=$$application.adobe.pdf}September
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\October.pdf}{I=$$application.adobe.pdf}October
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\November.pdf}{I=$$application.adobe.pdf}November
                    {I=$$folder}Employee Summaries|{I=$$folder}2010|{DATA=2010\December.pdf}{I=$$application.adobe.pdf}December
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\January.pdf}{I=$$application.adobe.pdf}January
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\February.pdf}{I=$$application.adobe.pdf}February
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\March.pdf}{I=$$application.adobe.pdf}March
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\April.pdf}{I=$$application.adobe.pdf}April
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\May.pdf}{I=$$application.adobe.pdf}May
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\June.pdf}{I=$$application.adobe.pdf}June
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\July.pdf}{I=$$application.adobe.pdf}July
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\August.pdf}{I=$$application.adobe.pdf}August
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\September.pdf}{I=$$application.adobe.pdf}September
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\October.pdf}{I=$$application.adobe.pdf}October
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\November.pdf}{I=$$application.adobe.pdf}November
                    {I=$$folder}Employee Summaries|{I=$$folder}2011|{DATA=2010\December.pdf}{I=$$application.adobe.pdf}December
                    There can be only one.

                    Comment


                      #11
                      Re: Need help with Drop-Down Tree Control

                      Great idea Stan.

                      Comment


                        #12
                        Re: Need help with Drop-Down Tree Control

                        Code:
                        DIM SHARED PDF_Path as C
                        PDF_Path = "C:\PDFs\\"
                        t1 = table.external_record_content_get("base","alltrim(Type) + \"|\" + alltrim(C_Yr) + \"|\" + alltrim(Mn)","Type+c_yr+padl(alltrim(str(month_number(Mn))),2,\"0\")")
                        t2done = *for_each(foo,"{I=$$folder}"+word(word(t1,*COUNTER(),crlf()),1,"|")+"|"+"{I=$$folder}"+word(word(t1,*COUNTER(),crlf()),2,"|")+"|"+"{DATA="+word(word(t1,1,crlf()),2,"|")+"\\"+word(word(t1,*COUNTER(),crlf()),3,"|")+".pdf"+"}{I=$$application.adobe.pdf}"+word(word(t1,*COUNTER(),crlf()),3,"|"),t1)
                        vMenuItems = t2done
                        
                        vChoice = ui_popup_menu(vMenuItems)
                        IF vChoice = "Cancel" .OR. vChoice = ""
                        END
                        END IF
                        
                        sys_open(PDF_Path+vChoice)
                        There can be only one.

                        Comment

                        Working...
                        X