Reputation: 265
I have a p:datatable
within a p:rowexpansion
that has a p:column
containg a h:inputText
form to change some value in the backing bean:
<p:dataTable var="myVar">
<p:rowExpansion>
...
<p:dataTable value=#{myVar.someList} var=invoiceSummationLine">
<p:column>
<h:inputText value="#{invoiceSummationLine.amountAsDouble}" disabled="#{backerBean.savedOK}" size="10"/>
</p:column>
</p:dataTable>
</p:rowExpansion>
</p:dataTable>
"savedOK" is only toggled after the entire form is submitted and validated some other place.
The problem is that when I close the rowExpansion, not only does the values in the h:inputText not get remembered upon re-opening, the log also throws JSF warnings of the kind:
There should always be a submitted value for an input if it is rendered, its form is submitted, and it was not originally rendered disabled or read-only. You cannot submit a form after disabling an input element via javascript. Consider setting read-only to true instead or resetting the disabled value back to false prior to form submission.
from what I understand this has to do with some mis-matching of the disabled states on input forms, but I cannot find other explanations for how to solve this issue on rowToggle, only for generic form submissions. Anyone?
Upvotes: 0
Views: 354
Reputation: 525
It is a bug in Prime faces. The content of the closed rowExpansion gets removed from DOM so whatever is in it is set to null (therefore your error).
If you only need to use that for inputText, you are in luck. Add:
<f:ajax render="randomInputText" event="keyup" />
The field starts working as you would expect. If you need the same for a checkbox, you are out of luck. This fix (with "change" as the event) fixes reseting the value when opening and closing the expansion, however if the expansion is closed during submit, null is set no matter what was the user input.
Upvotes: 0