Mercurial > urweb
view demo/crud2.ur @ 1907:cb57ba73a61d
make uninstall: Uninstall types_cpp.h, urweb_cpp.h
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Fri, 22 Nov 2013 09:36:14 -0500 |
parents | 669ac5e9a69e |
children |
line wrap: on
line source
table t : {Id : int, Nam : string, Ready : bool} PRIMARY KEY Id open Crud.Make(struct val tab = t val title = "Are you ready?" val cols = {Nam = Crud.string "Name", Ready = {Nam = "Ready", Show = (fn b => if b then <xml>Ready!</xml> else <xml>Not ready</xml>), Widget = (fn [nm :: Name] => <xml> <select{nm}> <option>Ready</option> <option>Not ready</option> </select> </xml>), WidgetPopulated = (fn [nm :: Name] b => <xml> <select{nm}> <option selected={b}>Ready</option> <option selected={not b}>Not ready</option> </select> </xml>), Parse = (fn s => case s of "Ready" => True | "Not ready" => False | _ => error <xml>Invalid ready/not ready</xml>), Inject = _ } } end)