this question has answer here:
my selectonemenu neither call setter nor getter after chosing option. map displayed correctly in dropdown.
here code:
<p:selectonemenu id="filter" value="#{mypatientsbean.selectedfilter}" valuechangelistener="#{mypatientsbean.activatedefaultfilter}"> <f:selectitems value="#{mypatientsbean.defaultfilterentries.entryset()}" var="map" itemvalue="#{map.value}" itemlabel="#{map.key}"/> <p:ajax update="patientdata" event="change" /> </p:selectonemenu> and here backing bean:
public map<string, string> getdefaultfilterentries() { return getpatientforfilter().getdefaultfilterentries(getcurrentuser().hasright(userright.patientviewall)); } public void setselectedfilter(string index) { selectedfilter = integer.parseint(index); if (selectedfilter == -1) { setusedefaultfilter(false); } } public string getselectedfilterstring() { return integer.tostring(selectedfilter); } the valuechangelistener called too..
would grateful help. tried :( list doesn't solve problem neither.
just remove valuelistener , replace ajax tag below
<p:ajax listener=#{mypatientsbean.activatedefaultfilter}" update="patientdata" />
Comments
Post a Comment