How to edit values in GUI in a datatable in JSF?
Hello!
Is it possible to edit values in a datatable in JSF?
I have this code, which is displaying nicely, but do not store the input in the dataclass! The "kurztext.sprache" is shown correctly and "kurztext.text" also if it has already data. But changes of "kurztest.text" in the GUI are not reflected to the dataclass!
Code:
<p:fieldset styleClass="emailSettingFieldset" legend="Materialkurztexte" style="width: 30%;height:240px; text-align:right;margin-left: 600px; margin-top: -276px">
<div class="row">
<div class="col-md-12">
<p:dataTable id="kurzTexte" var="kurztext"
value="#{data.materialStammData.materialkurztext}"
editable="true" style="margin-bottom:0px"
rowIndexVar="rowIndex" editingRow="true">
<p:ajax event="rowEdit" />
<p:ajax event="rowEditCancel" />
<p:column headerText="Sprache" style="width: 135px">
<h:outputText value="#{kurztext.sprache}"
style="margin-left: 15px;" />
</p:column>
<p:column headerText="Kurztext">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{kurztext.text}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{kurztext.text}" style="width:97%"
label="KurztextEingabe" />
</f:facet>
</p:cellEditor>
</p:column>
</p:dataTable>
</div>
</div>
</p:fieldset>
Kind regards,
Helmut