jsf 2 - Could the setter be omitted in JSF -


i'm using wildfly 8.0.2 along primefaces 5.2, have p:datatable, column have p:inputswitch, value on p:inputswitch method (that return either true or false), not have setter method, have attached p:ajax handle switching event (on/off), when change value raise javax.el.propertynotwritableexception: illegal syntax set operation exception (cause value method ... , has no setter). here code:

<p:column styleclass="status #{employee.haveskill(skill) == true ? 'have' : 'dosnthave'}">     <div style="text-align: center;">         <p:inputswitch value="#{employee.haveskill(skill)}" onlabel="#{msgs.yes}" offlabel="#{msgs.no}">             <p:ajax listener="#{skillscontroller.addskill(employee, skill)}" />         </p:inputswitch>     </div> </p:column> 

i have tried c:set, stores result of method in variable , assign p:inputswitch component, didnt work me, , p:inputswitch set false (although el expression style class of cell working fine), here code have tried:

<p:column styleclass="status #{employee.haveskill(skill) == true ? 'have' : 'dosnthave'}">     <div style="text-align: center;">         <c:set var="have" value="#{employee.haveskill(skill)}" scope="request" />         <p:inputswitch value="#{have}" onlabel="#{msgs.yes}" offlabel="#{msgs.no}">             <p:ajax listener="#{skillscontroller.addskill(employee, skill)}" >             </p:ajax>         </p:inputswitch>     </div> </p:column> 

so there way tell jsf or el not fire "set" method component? , execute listener on ajax??

update: have tried ui:param, raises javax.el.propertynotwritableexception :

<p:column styleclass="status #{employee.haveskill(skill) == true ? 'have' : 'dosnthave'}">     <div style="text-align: center;">         <ui:param name="have" value="#{employee.haveskill(skill)}" />         <p:inputswitch value="#{have}" onlabel="#{msgs.yes}" offlabel="#{msgs.no}">             <p:ajax listener="#{skillscontroller.addskill(employee, skill)}" >             </p:ajax>         </p:inputswitch>     </div> </p:column> 


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -