Java Reference
In-Depth Information
</h1>
<h1>
<af:panelFormLayout id="pfl1">
<f:facet name="footer" />
<af:inputText label="Catalog Id" id="it7"
binding="#{backing_create.it7}" />
<af:commandButton text="Find" id="cb2"
binding="#{backing_create.cb2}" action="#{backing_
create.cb2_action1}" />
</af:panelFormLayout>
</h1>
</af:form>
</af:document>
</f:view>
<%--
oracle-jdev-comment:preferred-managed-bean-name:backing_create
--%>
In the find() method in the managed bean, retrieve the catalog id using the
getValue() method for the UI component:
int id = Integer.parseInt((String)it7.getValue());
Create an InitialContext object and lookup the remote interface of the session
bean using the mapped name for the session bean:
CatalogSessionEJB catalogSessionEJB = (CatalogSessionEJB)
context.lookup("EJB3-JSF-EJB3Model-CatalogSessionEJB#model.
CatalogSessionEJB");
Invoke the findEntity() method of the session bean. The findEntity() method
returns a Catalog entity instance. Set the value of a managed bean's variable of type
Catalog to the entity instance retrieved:
catalog = catalogSessionEJB.findEntity(id);
The find() method returns a String "catalogentry", which has navigation set to the
catalogentry.jsp JSF page.
The catalog entry JSF page
The catalogentry.jsp has af:outputLabel components corresponding to a
catalog entry's properties. Next, add ADF Faces components to catalogentry.
jsp . Add a Heading 1 and set its style and text. Add a Panel Form Layout to
catalogentry.jsp .
 
Search WWH ::




Custom Search