Note that there are some explanatory texts on larger screens.

plurals
  1. POPrimefaces cellEditor passing the entire datatable in ajax submit
    primarykey
    data
    text
    <p>I have a datatable in which each row has 24 hour input fields in it. At one point of time there are more than 1000 editable input fields. I noticed that while using p:cellEditor during ajax calls primefaces is submitting the entire datatable. How can I avoid that? Please find below the code that I have, and also find the comments on each important parts in them.</p> <pre><code> &lt;!-- Fires the cellEdit event to trigger the validations to happen as user tabs out of the input box --&gt; &lt;p:ajax event="cellEdit" listener="#{renderValidator.onCellEdit}" update=":#{p:component('globalMessages')}" process="@this" /&gt; &lt;p:column id="hour1" styleClass="col-right col-90"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="1" escape="false"/&gt; &lt;/f:facet&gt; &lt;p:cellEditor &gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{row.amount[0]}" escape="false"&gt; &lt;f:convertNumber maxFractionDigits="3" minFractionDigits="3" maxIntegerDigits="5" /&gt; &lt;/h:outputText&gt; &lt;/f:facet&gt; &lt;f:facet name="input"&gt; &lt;p:inputText id="hour1Input" value="#{row.amount[0]}" maxlength="10" size="10" readonly="#{row.readOnly}" onchange='PowerMeter.setPowerMeterChange()' styleClass="col-right" valueChangeListener="#{row.setDirtyFlag(true)}" &gt; &lt;!-- formats data the way its displayed --&gt; &lt;f:convertNumber maxFractionDigits="3" minFractionDigits="3" maxIntegerDigits="5" /&gt; &lt;!-- validates the input value w.r.t a custom validator --&gt; &lt;f:validator validatorId="hourlyValueValidator" for="hour1Input" /&gt; &lt;!-- javascript restricting user to input alpha numeric characters --&gt; &lt;pe:keyFilter testFunction="return PowerMeter.isValidMWH(this, c);" /&gt; &lt;/p:inputText&gt; &lt;/f:facet&gt; &lt;/p:cellEditor&gt; &lt;/p:column&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload