Alpha DevCon 2018
Results 1 to 7 of 7

Thread: Filtering Dropdown boxes with session variables

  1. #1
    Member
    Real Name
    Michael Scholin
    Join Date
    May 2007
    Location
    Madison, WI
    Posts
    321

    Default Filtering Dropdown boxes with session variables

    Using a grid, I fully understand and take advantage of session variables and defining augments to filter the views. However, when using a drop down box, you have a filter setting property available but no arguments will show up as a choice.

    How can I use a session variable to further filter what is displayed in a drop down box?

    While we are on this topic, how can I change the order of what is displayed in a drop down box?

    Thanks!

    Mike

  2. #2
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,775

    Default Re: Filtering Dropdown boxes with session variables

    Here is an example of filtering a dropdown. Notice it takes place in the A5W page.
    Code:
    with tmpl_tr_trustee
    	componentName = "tr_trustee"
    	field_info[6].DropDownBox.Filter = "Job_ID="+quote(session.__protected__jobid)
    	field_info[7].DropDownBox.Filter = "Job_ID="+quote(session.__protected__jobid)
    	field_info[8].DropDownBox.Filter = "Job_ID="+quote(session.__protected__jobid)
    	field_info[9].DropDownBox.Filter = "Job_ID="+quote(session.__protected__jobid)
    end with

    To set the order, I think you would have to play with the dialogs settings for Display versus Stored information. The dropdown will always display based on whatever field you include first in the Display setting. I'm thinking you could include a Sort field, so your display would include that number prior to the actual value.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  3. #3
    Member
    Real Name
    Michael Scholin
    Join Date
    May 2007
    Location
    Madison, WI
    Posts
    321

    Default Re: Filtering Dropdown boxes with session variables

    Steve - that will do it! Thanks so much.

    Boy, you have really been the "answer man" lately (more so than normal) - I know we all appreciate what you do.

    I hope Alpha acknowledges this in some way as well!

  4. #4
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,775

    Default Re: Filtering Dropdown boxes with session variables

    It's easy to answer when the questions are often the same. The only thing I do is look in some old application where I "did that" and refresh how it was done. I can't actually remember most of this as it exactly must be applied. I also really do have a very long Word doc that I built up over the years categoriezed by topic. So I can pull out the generic solutions from that document too.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  5. #5
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,620

    Default Re: Filtering Dropdown boxes with session variables

    This should help me make headway with a problem I have had. But if the component is a gridlinker I have something like
    ?x_GridLinker.MRcapacity2.Output.Body.Grid_HTML

    Is it still possible to override settings of the individual grid in this case?

    Bill.

  6. #6
    Member
    Real Name
    Bob Alston
    Join Date
    Feb 2012
    Location
    Dallas
    Posts
    180

    Default Re: Filtering Dropdown boxes with session variables

    Steve
    Would you mind please elaborating on your example? I need to filter the contents of a drop down box, using a page variable.

    Is the code Xbasic code go? Where does it go?

    I just don't get the syntax.

    bob
    Bob Alston
    -------------------------------------------------------------------
    http://webpages.charter.net/bobalston/bob1.htm
    Alpha five v11 Tips

  7. #7
    Member
    Real Name
    Bob Alston
    Join Date
    Feb 2012
    Location
    Dallas
    Posts
    180

    Default Re: Filtering Dropdown boxes with session variables

    I have a dropdownbox.Can't set the criteria to a pagevariable but I can to a session variable.


    The last line of help text shows the syntax for using a session variable. It appears that that is working in working preview.
    I will just set a session variable equal to the page variable.
    Bob Alston
    -------------------------------------------------------------------
    http://webpages.charter.net/bobalston/bob1.htm
    Alpha five v11 Tips

Similar Threads

  1. Calendar going behind the dropdown boxes
    By sendamail in forum Application Server Version 9 - Web/Browser Applications
    Replies: 12
    Last Post: 09-23-2008, 08:29 AM
  2. Newbie Question Regarding Dropdown boxes
    By cbroadh in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 05-19-2008, 04:42 PM
  3. problem with dropdown boxes in lookup field
    By Lance Gurd in forum Alpha Five Version 6
    Replies: 2
    Last Post: 10-20-2005, 07:46 AM
  4. Filtering dropdown by session variable
    By rhofrichter in forum Web Application Server v6
    Replies: 2
    Last Post: 10-12-2005, 08:32 AM
  5. Dropdown boxes: how to set for multiple choices?
    By LTinPB in forum Web Application Server v6
    Replies: 5
    Last Post: 03-25-2005, 07:10 AM

Posting Permissions

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