组件类现在负责定义和管理表单控制器模型。
The component class is now responsible for defining and managing the form control model.
为了让此表单正常工作,我从控制器开始处理。
它提交回表单本身,因此会用到同一个控制器。
It submits back to itself, so the same controller will be used.
应用程序控制器利用它直接传入表单数据。
This is used by the application controller to simply pass in the form data directly.
然后,需要向Student控制器(清单6)添加一个函数,以便能够看到这个HTML表单。
Then you need to add a function to the Student controller (Listing 6) to be able see the HTML form.
最后,为每个控制器创建一个称为invalid的操作,并使用这个方法通知用户提交的表单无效。
Finally, create an action for each controller called invalid and use the method to inform the user that their form submission was invalid.
接下来,为了接收这个表单发布,向Student控制器添加函数update();代码如清单19 所示。
Next, to receive the form post, add the function update() to the Student controller; the code is shown in Listing 19.
最重要的是,XForms分隔表单的数据模型、视图和控制器。
Most importantly, XForms splits a form's data model, view, and controller.
如果在HTML表单中将String字段保留为空,paramsmap中的控制器会将其看作空string(也就是“ ”),而不是null。
If you leave a String field blank in an HTML form, it comes back to the controller in the params Map as an empty String (that is, ) instead of null.
这个页面使用form_remote_tag把简单表单的内容提交到控制器中的add方法。
This page USES the form_remote_tag to submit the contents of the simple form to the add method in the controller.
在为Tor构建产品控制器时,已指定了要使用HTML和表单helpers。
When you built the products controller for Tor, you specified that the HTML and form helpers were in use.
此表单将指向comments控制器的write操作。
This form will point to the write action of the comments controller.
控制器经常需要访问输入数据,如查询字串值、表单值、以及通过路由系统从输入url解析所得到的参数。
Controllers frequently need to access incoming data, such as query string values, form values, and parameters parsed from the incoming URL by the routing system.
NETmvc中,控制器会定义通常与可能的使用者互动拥有一对一关系的动作方法,例如按一下连结或送出表单。
NET MVC, controllers define action methods that usually have a one-to-one relationship with possible user interactions, such as clicking a link or submitting a form.
NETmvc中,控制器会定义通常与可能的使用者互动拥有一对一关系的动作方法,例如按一下连结或送出表单。
NET MVC, controllers define action methods that usually have a one-to-one relationship with possible user interactions, such as clicking a link or submitting a form.
应用推荐