diff options
author | 2009-10-22 16:15:56 -0400 | |
---|---|---|
committer | 2009-10-22 16:15:56 -0400 | |
commit | df4090ae1a231b363a0bc5d38036628e738276ee (patch) | |
tree | a765ee0cd11f8b42d77606fa4d133daceefff056 /demo/more/conferenceFields.ur | |
parent | dff3c4a68a27213e3c2ebcd6223e14ae79842a7a (diff) |
Initial support for char in SQL
Diffstat (limited to 'demo/more/conferenceFields.ur')
-rw-r--r-- | demo/more/conferenceFields.ur | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/demo/more/conferenceFields.ur b/demo/more/conferenceFields.ur index be0843af..ae9ed5a7 100644 --- a/demo/more/conferenceFields.ur +++ b/demo/more/conferenceFields.ur @@ -2,3 +2,22 @@ open Meta val title = string "Title" val abstract = textarea "Abstract" + +fun charIn s = + if String.length s = 0 then + error <xml>Impossible: Empty option value</xml> + else + String.sub s 0 + +con dropdown = (char, string) +fun dropdown name opts = {Nam = name, + Show = txt, + Widget = fn [nm :: Name] => <xml><select{nm}> + {List.mapX (fn x => <xml><option>{[x]}</option></xml>) opts} + </select></xml>, + WidgetPopulated = fn [nm :: Name] v => <xml><select{nm}> + {List.mapX (fn x => <xml><option selected={x = v}>{[x]}</option></xml>) opts} + </select></xml>, + Parse = charIn, + Inject = _} + |