i am using jsf to develop an update form. I want to pass the custName to the bean by calling an edit method. My prblem is that i am getting the custName in the bean, but in the update.xhtml, the value is not displaying in editable format.
custmerDetails.jsf
<p:dataTable id="dataWork" var="work" value="#{customerBean.workList}" rowIndexVar="rownum" styleClass="#{not empty customerBean.workList ? '' : 'ui-helper-hidden' }">
<p:row>
<p:column>
<p:commandButton value="Click" action="#{customerBean.editWork}">
<f:setPropertyActionListener value="#{work}" target="#{customerBean.selectedWork}" />
</p:commandButton>
</p:column>
</p:row>
</p:dataTable>
Now in the bean: (i have getters and setters for custName in the bean)
public void editWork() {
FacesContext fc=FacesContext.getCurrentInstance();
try{
this.custName = selectedWork.getCustName();
System.out.println("Name:: " + custName);
ExternalContext context=fc.getExternalContext();
context.redirect(context.getRequestContextPath() + "/update.jsf");
}
catch (Exception e) {
e.printStackTrace();
}
}
In the update.xhtml page:
<p:panelGrid id="edit_work_dtls" style="float:left;overflow-x: auto;overflow-y: auto; width: 700px;">
<p:row>
<p:column width="25%;">
<h:outputText value="Customer Name:" />
</p:column>
</p:row>
<p:row>
<p:column width="25%;">
<p:inputTextarea rows="6" cols="20" value="#{customerBean.custName}"></p:inputTextarea>
</p:column>
</p:row>
</p:panelGrid>
I am not find a way out to display the custName in editable format in the update.xhtml