I've seen other posts about how to implement NameValueLists with optional toprows (to allow an unselected value), but I don't think anyone has mentioned the possibility of having a nullable type as the key/index. In most examples, the toprow's index for an "Unselected" value is either "" for strings or 0 for integers. My underlying table uses an int datatype that allows nulls. Historically, I've left the database field null to represent an unselected value, so I'd like to keep it that way. How can I specify in my NameValueList class that it should return a list of (nullable (of Integer), String)?
Joel
Joel,
David Wendelken created some types (SmartInt16, SmartInt32, etc.) that act like a SmartDate. Perhaps you can use a SmartInt32 as the key in the NVL. The key of the toprow can be an empty SmartInt32.
Cheers,
Herman
McManus:David Wendelken created some types (SmartInt16, SmartInt32, etc.) that act like a SmartDate. Perhaps you can use a SmartInt32 as the key in the NVL. The key of the toprow can be an empty SmartInt32.
Herman,
Thanks for the plug on the classes!
Here's the way I like to do sql server stored procs for the dropdownlists.
If the record is in insert mode, we bring back a <Choose> tag as the first entry.
If the field is optional, we bring back an empty tag as the next entry.
Sort_Order is a dummy column that allows us to force things to sort in a particular order.
CREATE
procedure [MySchema].[MyApp_MyTable_ddl]I usually just use strings (because my internal SmartInt32 variables are exposed as string properties).
Copyright (c) Marimer LLC