jsf - <f:ajax> doesn't work on PrimeFaces component -
i trying use onchange
event of selectonemenu
, doesn't work , component not displayed when add onchange
attribue.
can tell me how can handle onchange
event of <p:selectonemenu>
?
here view:
<p:selectonemenu id="service" filtermatchmode="startswith"> <f:selectitem itemlabel="selectionner un service : " /> <f:selectitems value="#{newopprogramme.listesevice}" var="service" itemvalue="#{service.serviceid}" itemlabel="#{service.servicenom}"/> <f:ajax event="change" execute="@this" listener="#{newopprogramme.servicechange()}" render="nomcdp"/> </p:selectonemenu>
and here <f:ajax listener>
method in request scoped bean:
public void servicechange() { system.out.println("change"); }
when change menu, however, nothing been printed.
how caused , how can solve it?
first of all, onchange
wrong event name. it's change
. secondly, if intend call html attribute name, onchange
wrong attribute name. it's onchange
.
coming concrete problem; standard jsf <f:ajax>
not compatible primefaces components. should using primefaces own <p:ajax>
instead.
<p:selectonemenu ...> ... <p:ajax listener="#{newopprogramme.servicechange()}" update="nomcdp" /> </p:selectonemenu>
note omitted event
, process
attributes. both have right default value of valuechange
, @this
respectively.
Comments
Post a Comment