Alpha DevCon 2018
Results 1 to 14 of 14

Thread: Cascading lists limit

  1. #1
    Member
    Real Name
    Betsy Smith
    Join Date
    Feb 2007
    Posts
    28

    Default Cascading lists limit

    I just realized there is a limit to the cascading lists. Is there any way around this? I still have info I need to add, is there any other way I can do this?
    (Alpha 5 Ver. 8)

    Betsy

  2. #2
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,536

    Default Re: Cascading lists limit

    By cascading list, are you referring to a field rule lookup?

    If so, you can do it w. xbasic. I can give you a sample code snippet (it's pretty simple really).

  3. #3
    Member
    Real Name
    Betsy Smith
    Join Date
    Feb 2007
    Posts
    28

    Default Re: Cascading lists limit

    Yes, I am referring to field rule lookup?

  4. #4
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,536

    Default Re: Cascading lists limit

    Quote Originally Posted by Betsy View Post
    Yes, I am referring to field rule lookup?
    Yes, followed by a "?"?

    I guess that means yes? ;)

    Anyway, if that's what you want, and you have hit a limit, get rid of that field rule.

    FIRST, from the controlpanel/code tab, create a new XBasic script, call it "test". Paste the following code into it and Save. Press the lightening bolt to run the code to see how it works.
    Code:
    vMenuItems = <<%a%
    Clone|Dick
    Clone|George
    Clone|Rice
    Critter|Rodent|Bat
    Critter|Rodent|Cat
    Critter|Rodent|Rat
    Critter|Rodent|Mouse
    Critter|Mammal|Dog
    Critter|Mammal|Fish
    Critter|Mammal|Pterodactyl
    Critter|Mammal|Stegasuarus
    Stooge|Moe
    Stooge|Larry
    Stooge|Curly
    a
    b
    c
    -
    Cancel
    %a%
    
    vMenuChoice = ui_popup_menu(vMenuItems)
    
    IF vMenuChoice = "Cancel" .or. vMenuChoice = ""
        End
    ELSE
        ObjectName.value = vMenuChoice
    END IF
    Then: Put a button on your form next to the field you want to fill and paste the above code in the button's OnPush event:

    In your button's code, change "ObjectName"to the name of the field object (which Alpha usually names the same as the field name). You can see the field object name by putting the form in edit mode and hovering the mouse over the field. Change the selections to your entries as needed. The pipe "|" separates the items (as you can see) and create the "menu" heirarchy. As far as I know, there is no practical limit to how many items or cascades you wish to use.
    Last edited by Peter.Greulich; 03-12-2009 at 11:51 AM.

  5. #5
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,536

    Default Re: Cascading lists limit

    I usually use a button (to the right of the field) that looks something like this - see image.

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,954

    Default Re: Cascading lists limit

    Sweet. I imagine you could populate vMenuItems with entries from a table so you wouldn' have to edit the code to make changes.
    There can be only one.

  7. #7
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,536

    Default Re: Cascading lists limit

    Quote Originally Posted by Stan Mathews View Post
    Sweet. I imagine you could populate vMenuItems with entries from a table so you wouldn' have to edit the code to make changes.
    Yes. Been there, done that. :)

  8. #8
    "Certified" Alphaholic
    Real Name
    Raymond Lyons
    Join Date
    Apr 2000
    Location
    Carlsbad, CA
    Posts
    2,140

    Default Re: Cascading lists limit

    Peter and Stan,

    Seems to me that this is an example of a case in which you (all of us) could very easily be more helpful to new users by throwing in another code snippet outlining one way one might follow up on Stan's suggestion. Otherwise I am afraid many new users would just be at a loss as to what Stan was referring to, plus these little code snippets are a great way for new users to learn. To that end, below is one way to do what Stan was referring to:

    Raymond Lyons

    Code:
    'Create a 1 record, 1 field table with a memo field, here named Menu
    'Enter (or paste in) Peter's sample items in the memo field (here named Menuitems)
    'If for some reason it is more than 1 record you can add (as below) tbl.fetch_first()
    'Also, you could dim and set vMenuItems as a global variable in the autoexec using part of the code below.
    'This would avoid having to open and close a table every time the menu is used.
    
    dim tbl as p
    tbl=table.open("menu")
    tbl.fetch_first()
    dim vMenuItems as c
    vMenuItems= tbl.Menuitems
    
    vMenuChoice = ui_popup_menu(vMenuItems)
    
    IF vMenuChoice = "Cancel" .or. vMenuChoice = ""
        tbl.close()
        End
    ELSE
        ObjectName.value = vMenuChoice
        msgbox(vMenuChoice)    'this line is just for testing-- rem it out
        tbl.close()
    END IF

  9. #9
    Member Larry Gordon's Avatar
    Real Name
    Larry Gordon
    Join Date
    May 2008
    Location
    Worcestershire, UK
    Posts
    389

    Default Re: Cascading lists limit

    Peter/Raymond,
    Most excellent! I have tried to adapt your code so that I can use it as a menu. I have studied the Help file on same and so far have failed miserably. I have way too many buttons on my current menu's, with menu's calling sub menu's etc. What I would like to do is place all my current button scripts into the cascade, then make a selection from the cascade which (a) closes the current form, and (b) opens the relevant form, report or browse. Can I adapt your code to do this or am I barking up the wrong tree?
    Many thanks
    Larry Gordon

  10. #10
    Member Larry Gordon's Avatar
    Real Name
    Larry Gordon
    Join Date
    May 2008
    Location
    Worcestershire, UK
    Posts
    389

    Default Re: Cascading lists limit

    Whoops - should have said I'm on V9.

  11. #11
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,536

    Default Re: Cascading lists limit

    Quote Originally Posted by Larry Gordon View Post
    Can I adapt your code to do this or am I barking up the wrong tree?
    You are barking up the RIGHT tree. That is very doable.

  12. #12
    Member
    Real Name
    ken tjia
    Join Date
    Jan 2008
    Location
    Vancouver, BC Canada
    Posts
    560

    Default Re: Cascading lists limit

    Quote Originally Posted by Peter.Greulich View Post
    By cascading list, are you referring to a field rule lookup?

    If so, you can do it w. xbasic. I can give you a sample code snippet (it's pretty simple really).
    is there any limit to TREE CONTROL contain size?
    i do not seem to show a big tree?

  13. #13
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,123

    Default Re: Cascading lists limit

    Quote Originally Posted by Raymond Lyons View Post
    Seems to me that this is an example of a case in which you (all of us) could very easily be more helpful to new users by throwing in another code snippet outlining one way one might follow up on Stan's suggestion. Otherwise I am afraid many new users would just be at a loss as to what Stan was referring to, plus these little code snippets are a great way for new users to learn.
    Ray,
    I agree so I took it a bit further. The attached example illustrates making a global variable from the values of a List table used for a popup menu.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  14. #14
    Member
    Real Name
    Robert Carolina
    Join Date
    Sep 2006
    Posts
    38

    Default Re: Cascading lists limit

    I have not been on this message board for about 10-years. I recently upgraded to V11, and I find that while some things are better, some are still the way they were. I think it is kind of funny that Alpha has not been able to make some of these solutions, a permanent part of the program. After all not everyone is a great programmer, nor does everyone have the time to look through the maze of documentation, and by the way, the new documentation is horrible. That is my opinion.

    As for the professional on this message board; you are the greatest. If it were not for you, many newcomers would just give-up at the very beginning. You do way more than it could ever be expected, and for that, I thank you very much. I have never come across a community of people such as you.

    Once again: Thanks, thanks, thanks, and thanks again.

Similar Threads

  1. Cascading Print lists
    By Rick Sloan in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 01-22-2009, 06:23 PM
  2. User Maintained Cascading Lists
    By Ted Giles in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 09-24-2008, 08:57 AM
  3. Cascading Lists (Field Rules)
    By peter284 in forum Alpha Five Version 8
    Replies: 1
    Last Post: 03-15-2007, 10:44 PM
  4. Populating Cascading Lists
    By John Castle in forum Alpha Five Version 5
    Replies: 6
    Last Post: 07-22-2005, 08:13 AM
  5. Cascading dropdown lists
    By patrick saunders in forum Alpha Five Version 6
    Replies: 5
    Last Post: 02-08-2005, 10:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •