comparison demo/prose @ 781:c884a42599f3

crud3 demo
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 May 2009 16:00:43 -0400
parents 0084af7af35a
children 305bc0a431de
comparison
equal deleted inserted replaced
780:0084af7af35a 781:c884a42599f3
229 229
230 crud2.urp 230 crud2.urp
231 231
232 <p>This example shows another application of <tt>Crud.Make</tt>. We mix one standard column with one customized column. We write an underscore for the <tt>Inject</tt> field of meta-data, since the type class facility can infer that witness.</p> 232 <p>This example shows another application of <tt>Crud.Make</tt>. We mix one standard column with one customized column. We write an underscore for the <tt>Inject</tt> field of meta-data, since the type class facility can infer that witness.</p>
233 233
234 crud3.urp
235
236 <p>One thing that is unclear from the previous examples is how to provide more complex, multi-input widgets for taking input meant for particular fields. The signature of <tt>Crud.Make</tt> forces every widget to define exactly one input. The <tt>&lt;subform&gt;</tt> tag, the simpler cousin of the <tt>&lt;subforms&gt;</tt> tag that we saw earlier, provides a fix for this problem. Via <tt>&lt;subform&gt;</tt>, an arbitrary form can be turned into a single record-valued input.</p>
237
238 <p>We use that possibility here to define a silly widget for a <tt>string</tt> column, which concatenates the values entered into two different textboxes.</p>
239
234 alert.urp 240 alert.urp
235 241
236 <p>Ur/Web makes it easy to write code whose execution should be distributed between the web server and client web browsers. Server-side code is compiled to efficient native code, and client-side code is compiled to JavaScript. Ur/Web programmers don't need to worry about these details, because the language and standard library provide a uniform ML-like interface for the whole process.</p> 242 <p>Ur/Web makes it easy to write code whose execution should be distributed between the web server and client web browsers. Server-side code is compiled to efficient native code, and client-side code is compiled to JavaScript. Ur/Web programmers don't need to worry about these details, because the language and standard library provide a uniform ML-like interface for the whole process.</p>
237 243
238 <p>Here's an example of a button that, when clicked, opens an alert dialog on the client.</p> 244 <p>Here's an example of a button that, when clicked, opens an alert dialog on the client.</p>