You use the Insert JSF Form to insert a JSF UIForm component into a JSP page. A UIForm component represents an input form that has child components representing data that is either presented to the user or submitted with the form. You open the dialog box by opening any JSP page and dragging the JSF Form entry from the Palette window into the JSP file.
You can generate either of the following:
<f:view> <h:form> </h:form> </f:view>
If you speficied a read-only form, the IDE enters the following code in the page:
<f:view> <h2>Detail</h2> <h:form> <h:panelGrid columns="2"> <h:outputText value="column1-title:"/> <h:outputText value="#{anInstanceOfclass-name.column1}" title="column1-title" /> ... </h:panelGrid> </h:form> </f:view>If you speficied an editable form, the IDE enters the following code:
<f:view> <h2>Create</h2> <h:form> <h:panelGrid columns="2"> <h:outputText value="column1-title:"/> <h:inputText title="column1-title" value="#{anInstanceOfclass-name.column1}" title="column1-title" /> </h:panelGrid> </h:form> </f:view>In the generated code, you have to replace the anInstanceOfclass-name variable with a property in a JSF managed bean that refers to a single entry in the data source. Note that the JSF managed bean is often not the entity class itself but a separate controller class.
Notes:
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>