Alpha Video Training
Results 1 to 5 of 5

Thread: dropdown box

  1. #1
    Member
    Real Name
    Jenny Gong
    Join Date
    Jul 2013
    Posts
    282

    Default dropdown box

    I use a dropdown box to search, driodown box's value comes from a column in dabase, which has "FA", "PR". I am wondering is that possible, it displays as "Fund Accounting", "Pay Roll", instead of "FA","PR". but background DATABASE still use "FA","pr"

  2. #2
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,309

    Default Re: dropdown box

    Yes. Use the displayed value. Stored value is still "FA" - or whatever - and your displayed value can be anything you want. Is "Fund Accounting" associated with "FA" in some way inside your database? EG, you have a column in a table somewhere that contains values, such as "Fund Accounting" and "Pay Roll", that are associated with your existing column containing "FA" and "PR"?

    EDIT:

    The reason I'm asking is because if you do store the extended name/meaning of your two-letter values inside your database, then you can do this with a simple SQL SELECT using the Dynamic option. Otherwise, you'll need to implement your dropdown choices in a variable that is populated when the grid is initialized (the Variable option for populating your dropdown in the dropdown's choices property.)
    Last edited by TheSmitchell; 11-04-2013 at 12:19 PM.
    Alpha Anywhere latest pre-release

  3. #3
    Member
    Real Name
    Jenny Gong
    Join Date
    Jul 2013
    Posts
    282

    Default Re: dropdown box

    Thank you for your answer!! But I do not have that column associated with "FA" and "PR", so i have to use xbasic code to overwrite the dropdown choices property in grid initialized, is that correct? Could you give some demo code to do that? Very appreciate your help!!!

  4. #4
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,309

    Default Re: dropdown box

    I tried to find you some documentation on this that would help get you started, but I am google fail.

    First off, open the choices setting for your dropdown box and check "variable":



    You'll see some help information here about what you need to do in order to setup the variable definition for your dropdown.

    Next. Check out onGridInitialize:

    Code:
    function OnGridInitialize as v (e as p)
    'This event fires when the Grid is initialized. It also fires when the Grid is
    're-initialized after a session has expired.
    'IMPORTANT: The onGridExecute event, which fires every time the Grid is executed fires BEFORE this event.
    
    'NOTICE: If you want to override a Grid property, use the OnGridExecute event.
    
    'e.tmpl - component definition
    'e.rtc - Run-time calculations (allows you to pass data to other event handlers)
    
    'Request - The Request object. Includes Request.Variables, which should be used instead of the older e.rv construct
    'Session - The Session object. Should be used instead of the older e.session construct
    '		 - To set a session variable: Session.myNewSessionVariable = "Alpha"
    
    'Example:
    'Define a list for a drop-down box
    'e.rtc.list1 = comma_to_crlf("Red,Green,Blue")
    
    
    end function
    This is where you define that list. For example:

    Code:
    function OnGridInitialize as v (e as p)
    dim list as c =<<%txt%
    Choice 1|A
    Choice 2|B
    Choice 3|C
    None|Z
    %txt%
    
    e.rtc.list1 = list
    end function
    Retrieving data out of your database will require connections and such, which you can learn about here (has videos and such): http://wiki.alphasoftware.com/Learni...20SQL%20Tables

    Other functions that may (or may not) be handy for creating your list:


    That should get you started. If you need more help, feel free to post back here.
    Attached Images Attached Images
    Alpha Anywhere latest pre-release

  5. #5
    Member
    Real Name
    Jenny Gong
    Join Date
    Jul 2013
    Posts
    282

    Default Re: dropdown box

    Thank you very much!!!!!!!!!!!! You are the best!!!!!!!!!!

Similar Threads

  1. How to get dropdown box value based on other drop down box in grid?
    By satyanarayana in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 05-31-2012, 09:05 AM
  2. Dropdown box with many table
    By Cristiano in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 01-31-2012, 06:35 AM
  3. Sort Dropdown Box
    By billkay in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 04-23-2010, 09:52 AM
  4. Help with Dropdown Box Search
    By jkletrovets in forum Application Server Version 8
    Replies: 1
    Last Post: 05-13-2009, 08:57 AM
  5. Dropdown box
    By Sonia Sidhwaney in forum Web Application Server v6
    Replies: 3
    Last Post: 06-29-2005, 05:38 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
  •