jsf - ajax listener was not updated the panels for selected item in primefaces -
iam trying update panel based selected data using primefaces selectonemenu , ajax listener taken care updating panels.but panel not updated , selected item shown @ console window.that means ,the ajax call got managed bean.but not updated @ faces pages , mentioned code
<p:panelgrid columns="1" style="align:center;width:80%" styleclass="companyheadergrid"> <p:row> <p:column><h:outputlabel for="runobject" value="run object: " /></p:column> <p:column> <p:selectonemenu id="selectedstate" value="#{taschedulebean.selectedrunobjectitem}" > <p:ajax listener="#{taschedulebean.changepanelstate}" render="@this" update=":form:displaydailypanel"/> <f:selectitem itemlabel="select one" itemvalue="select one" /> <f:selectitems value="#{taschedulebean.runobjectsvalue}" /> </p:selectonemenu> </p:column> </p:row> <p:row id="displaydailypanel" rendered="#{taschedulebean.appselectedrunobject eq 'daily'}"> <p:column> <p:outputlabel value=" n days" /> <p:outputlabel value="days=" /><p:inputtext id="s"/> </p:column> </p:panelgrid>
i read relevant issues in same forums , other forums also. issue not resolved.how can resolve this.please me
update :-
managedbean
public class taschedulebean extends tasbean { private string selectedrunobjectitem=""; private string appselectedrunobject=""; taschedulebean(){ } public void changepanelstate(){ string methodname="changepanelstate"; setpanelisvisible(true); talogger.log(logger.info, classname, methodname, "---------"+getselectedrunobjectitem()); setappselectedrunobject(getselectedrunobjectitem().trim()); } }
thanks guys.i resolved issue.when selected item time row not created because called 'rendered' attribute.so created panel , mentioned below code
<p:panel id="toppanel"> <------- added panel <p:panelgrid columns="1" style="align:center;width:80%" styleclass="companyheadergrid"> <p:row> <p:column><h:outputlabel for="runobject" value="run object: " /></p:column> <p:column> <p:selectonemenu id="selectedstate" value="#{taschedulebean.selectedrunobjectitem}" > <p:ajax listener="#{taschedulebean.changepanelstate}" render="@this" update="toppanel"/> <------changed <f:selectitem itemlabel="select one" itemvalue="select one" /> <f:selectitems value="#{taschedulebean.runobjectsvalue}" /> </p:selectonemenu> </p:column> </p:row> <p:row id="displaydailypanel" rendered="#{taschedulebean.appselectedrunobject eq 'daily'}"> <p:column> <p:outputlabel value=" n days" /> <p:outputlabel value="days=" /><p:inputtext id="s"/> </p:column> </p:panelgrid> </p:panel>
then working fine.
Comments
Post a Comment