Mercurial > urweb
view demo/crud3.ur @ 785:fe63a08cbb91
Table constraint Ur code
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 05 May 2009 12:49:16 -0400 |
parents | c884a42599f3 |
children | 669ac5e9a69e |
line wrap: on
line source
table t : {Id : int, Text : string} PRIMARY KEY Id open Crud.Make(struct val tab = t val title = "Crud3" val cols = {Text = {Nam = "Text", Show = txt, Widget = (fn (nm :: Name) => <xml> <subform{nm}> <textbox{#A}/> <textbox{#B}/> </subform> </xml>), WidgetPopulated = (fn (nm :: Name) s => <xml> <subform{nm}> <textbox{#A} value={s}/> <textbox{#B}/> </subform> </xml>), Parse = (fn p => p.A ^ p.B), Inject = _ } } end)