Form and Editor

In this chapter, we will bulid a Create Mail form by NUI.

NUI Form

Create anthor template named createmail.nui.xml and copy content from showmail.nui.xml. Then replace p:value with p:editor. Remember add a submit button.
Copy showmail.jsp and rename as "newmail.jsp" and change template name into "samples-createmail". Then you can got a new UI:

Now we have a UI to modify Mail info, but we still need a Form tag to post inputs. So, add a form template in template createmail:
<table>
	<n:form>
	...
	</n:form>
</table>
The n:form template render a html form tag and other content include validators.
Form use 'nuiform' as its id attribute if has no id attribute assigned.

Editor and Type

We can see that "mail" property use two separate textbox as its editor, and other property use single textbox. You can assign a editor for every property, if you not, NUI choose a editor according property type.
The "content" property need a larger input box, typically a TextArea tag. To do this, hange its type from text into 'longText':
	<property name="content" type="longText">
Then content property editor change to a TextArea.

Next