I have a popup inside that popup
I have a form <h:form id="vpmoForm">
inside this I have a datatable <p:dataTable id="reqTypeDtbl">
and inside that datatable I have an <h:inputText id="except" >
which I am rendering based on a conditon.
Here the <h:inputText id="except" >
should get rendered based on aother component <h:selectOneMenu>
ajax event in another column in same datatable
I got the condition in the backing bean but how do I update the <h:inputText id="except" >
to render it in the datatable.
Code that I using is given below
<p:dataTable id="reqTypeDtbl" scrollable="true" scrollHeight="150"
value="#{Bean.ReqDetailslsList}"
rowIndexVar="index" var="eachrow">
<h:selectOneMenu id="tssreq" value="#{vpmoReqDtlRow.tssReqId}"
rendered="#{Bean.vpmoEditFlag == true}">
<f:selectItems value="#{Bean.vpmoTSSList}"
var="tss" itemLabel="#{tss.label}" itemValue="#{tss.value}" />
<p:ajax listener="#{Bean.getTssId}"
execute="@this" partialSubmit="true" />
<f:param name="rowidno" value="#{index}" required="true" />
</h:selectOneMenu>
<h:inputText value="#{eachrow.exceptionNum}" id="except" style="width:100%" rendered="#{Bean.EditFlag == true and eachrow.tssReqId eq 'Y'}" />
</p:dataTable >
As I stated above ,I want to render the <h:inputText>
based on the another component <h:selectOneMenu>
when its ajax event is called and I want to enable the <h:inputText>
from the backing bean.
Here is the code that I am using for the Ajax method
public void getTssId(AjaxBehaviorEvent evt) {
Map<String, String> params = FacesContext.getCurrentInstance()
.getExternalContext().getRequestParameterMap();
int index = Integer.parseInt(params.get("rowidno"));
String selected = vpmoReqDetailslsList.get(index).getTssReqId();
if (selected.equalsIgnoreCase("y")) {
vpmoReqDetailslsList.get(index).setTssReqId("Y");
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.update(":vpmoForm:reqTypeDtbl:except"); //.....I AM TRYING TO UPDATE THE UI FROM HERE
}
I am trying to find a way to update the `<h:inputText id="except" >` component from the backing bean so that it can render in the UI.<br/>
Any suggestions will be really helpful to resolve this issue.