Relaxed the need for Types that represent database boundaries to extend from ActiveRe...
[castle.git] / Samples / Castle / PetStore.Web / views / ProductManagement / New.vm
blobf543564e708fd7875bd76895ab84b4e2d8a42154
1 <h2>New Product</h2>\r
2 \r
3 <div id="error">\r
4 #parse("shared/inlineerror.vm")\r
5 </div>\r
6 \r
7 #set ($validatorForm = "return validateForm( this, false, false, false, false, 5 ) " )\r
8 \r
9 $HtmlHelper.Form("create.rails", $DictHelper.CreateDict("method=post", "onsubmit=${validatorForm}", "enctype=multipart/form-data"))\r
11 <table border="0" cellpadding="2" width="360px">\r
12   <tr>\r
13     <td>$HtmlHelper.LabelFor("product.name", "Name:")</td>\r
14     <td>$HtmlHelper.InputText("product.name", $product.name, 25, 25, $DictHelper.CreateDict("validators=blank"))</td>\r
15   </tr>\r
16   <tr>\r
17     <td>$HtmlHelper.LabelFor("product.description", "Description:")</td>\r
18     <td>$HtmlHelper.TextArea("product.description", 30, 3, $product.Description)</td>\r
19   </tr>\r
20   <tr>\r
21     <td>$HtmlHelper.LabelFor("product.price", "Price:")</td>\r
22     <td>$HtmlHelper.InputText("product.price", $product.price.ToString(), 5, 5)</td>\r
23   </tr>\r
24   <tr>\r
25     <td>$HtmlHelper.LabelFor("product.category.id", "Category:")</td>\r
26     <td>\r
27     <!-- See how we manage to save a relation -->\r
28     $HtmlHelper.Select("product.category.id")\r
29       $HtmlHelper.CreateOptions($categories, "Name", "Id", $product.category.id)\r
30     $HtmlHelper.EndSelect()\r
31     </td>\r
32   </tr>\r
33   <tr>\r
34     <td>$HtmlHelper.LabelFor("picture", "Picture:")</td>\r
35     <td>$HtmlHelper.InputFile("picture")</td>\r
36   </tr>\r
37 </table>\r
39 <p>\r
40 $HtmlHelper.SubmitButton("Create")\r
41 </p>\r
43 $HtmlHelper.EndForm()\r