Alpha Video Training
Results 1 to 7 of 7

Thread: NULL value in Dropdown Box

  1. #1
    Member njguy's Avatar
    Real Name
    Tom Ritter
    Join Date
    Nov 2009
    Location
    New Jersey
    Posts
    289

    Default NULL value in Dropdown Box

    I have a DropDown Box that is populated by a table but I also want one of the choices to be a NULL value. Any suggestions?

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

    Default Re: NULL value in Dropdown Box

    Check NULL if blank (dialog) or Blank is NULL (grid)
    Add a value to the "Display value for no selection" option for the choices definition
    Alpha Anywhere latest pre-release

  3. #3
    Member njguy's Avatar
    Real Name
    Tom Ritter
    Join Date
    Nov 2009
    Location
    New Jersey
    Posts
    289

    Default Re: NULL value in Dropdown Box

    I have the initial value set to NULL and blanks are handled as NULL on updates. This is great on the initial entry but if you update an existing record that has a value the dropdown list does not contain a null choice.

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

    Default Re: NULL value in Dropdown Box

    It has been my experience that "Display value for no selection" adds the choice for all the dropdowns, existing & new. I don't know why it's not adding the option for your existing records.

    displayValueForNoSelection.png
    withNone.png
    Alpha Anywhere latest pre-release

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

    Default Re: NULL value in Dropdown Box

    Assuming that "Display value for no selection" is not working for you...

    If you're using SQL, you can put a null option in your drop down using a UNION of 2 select statements. However, Alpha chokes & dies on UNION. You'll need to create a view in your database schema with the UNION definition and use that in place of your current query.

    Alternatively, you could add a choice either (pre) or (post). You may or may not need to set the value for your field to NULL in the onBeforeSQLExecute server-side event.
    Alpha Anywhere latest pre-release

  6. #6
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: NULL value in Dropdown Box

    another way to do is
    when you define your choices after selecting all the things you need look down further there are two choices
    additional choices (pre) and (post) same picture as in post #4
    click on the pre and just add this pipe "|" sign (without the quotation.) nothing in front or back, just that pipe sign.
    you will get a null value displayed on the dropdown list.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  7. #7
    Member
    Real Name
    Dan Darkin
    Join Date
    Feb 2012
    Posts
    4

    Default Re: NULL value in Dropdown Box

    Gandhi, the | worked perfectly. Thank you.

Similar Threads

  1. Insert NULL option into dynamic dropdown list
    By TheSmitchell in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 06-04-2012, 05:23 PM
  2. 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, 10:05 AM
  3. DropDown Box problem....Showing value for NULL entries
    By leetv in forum Application Server Version 10 - Web/Browser Applications
    Replies: 8
    Last Post: 11-27-2011, 05:37 PM
  4. Dropdown 'BLANK IS NULL' when prechoices are used.
    By aburningflame in forum Application Server Version 10 - Web/Browser Applications
    Replies: 5
    Last Post: 05-04-2011, 02:33 PM
  5. stored value of null in Dropdown choices
    By Barry64 in forum Application Server Version 9 - Web/Browser Applications
    Replies: 2
    Last Post: 06-01-2009, 04:52 PM

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
  •