I have a datatable that uses the cell editor function. In each row, I have a dropdown and what I want is when a user chooses a different value in that dropdown, I want another cell in the current row to be updated.
Here’s my column:
<p:column headerText="Period">
<p:cellEditor>
<f:facet name="input">
<p:selectOneMenu value="#{pj_details.periodDates}" id="period" size="1" styleClass="listBoxMedium">
<p:ajax update="tabs:editProjects:projects" event="change" listener="#{ppBacker.populateProjectDates}" />
<f:attribute name="period_key" value="#{pj_details.periodDates}" />
<f:selectItems value="#{ppBacker.periods}" />
</p:selectOneMenu>
</f:facet>
<f:facet name="output">
<h:outputText value="#{pj_details.periodDates}" />
</f:facet>
</p:cellEditor>
</p:column>
My update works except it updates the enter form which throws the table out of celleditor mode.
Using firebug, I can see that the update I need looks like this:
tabs:editProjects:projects:1:projStartDate_input
Only problem with that is the number 1 in this example refers to the row.
So how can i udpate a cell in the same row as the dropdown without being thrown out of celleditor mode?
Please check the similar issue …
Jquery Onchange event not getting fired – Primefaces – inputText
Define rowIndexVar for the datatable and access the cells with the help of rowIndexVar
Hope this helps