dynamic - p:spinner p:ajax and f:param mixed together, bean method executed multiple times -
i'm developping primefaces 4.0, jsf mojarra 2.1.7 , jboss_7.1.1_final.
the tool i'm creating dialog window showing datatable dynamic columns (p:columns)
those dynamic columns show pspinner :
<p:spinner id="updateqj_#{colindex}_#{rowqj.idqbt}" widgetvar="updateqjjs_#{colindex}_#{rowqj.idqbt}" stepfactor="1" min="0" max="#{rowqj.qbttype}" value="#{rowqj.quantitedujour(qjcolonne.property)}" onkeydown="return false;" styleclass="editqj" rendered="#{not verrouille}" title="cliquez ici pour modifier la quantité journalière" > <p:ajax listener="#{recherche.updateqj}" update="@this, :formrecherche:growl" process="@this"/> <f:param name="idqbt" value="#{rowqj.idqbt}"/> <f:param name="jour" value="#{qjcolonne.property}"/> <f:param name="ligne" value="#{rowindex}"/> <f:param name="colonne" value="#{colindex}"/> </p:spinner> </p:column> </p:columns>
everything seems working fine till unknown reason, click in 1 of columns modifies current value plus 1 updated in column. see clearly: if keep clicking/updating spinners in same column works fine. if click spinner of column updates both. idea appreciated.
in primefaces4, p:spinner in cell made of p:columns>p:column doesn't behave should, first clicks work @ moments, simple click generates incessant ajax calls if clicked each spinner in each cell...after several days of workaround, , thinking pf makes usage of jquery under cover tried myself. surprisingly, firebug console logged 'spinner not function' , jquery.ui.version 1.10.3 downloaded 1.10.4 on jquery's site , included in header after other javascripts. jquery.ui.version showed 1.10.4 , no more error message appeared. :) finally, wrote in each p:column of p:columns in p:datatable
<input id="updateqj_#{rowindex}_#{colindex}_#{rowqj.idqbt}" widgetvar="updateqjjs" class="editqj" value="#{rowqj.listedesqj[colindex].quantiterealisee}"> </input> <script type="text/javascript"> jquery("input[id=updateqj_#{rowindex}_#{colindex}_#{rowqj.idqbt}]") .spinner({ min:0, max:#{rowqj.qmax}, step:1, change:function(){ rmt_updateqj([parameters]); } }); </script>
Comments
Post a Comment