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"
                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 headerText="Kurztext">
                        <f:facet name="output">
                            <h:outputText value="#{kurztext.text}" />
                        <f:facet name="input">
                            <p:inputText value="#{kurztext.text}" style="width:97%"
                                label="KurztextEingabe" />


Kind regards, Helmut

asked 13.09.2015 at 01:59

Helmut%20Burgemeister's gravatar image

Helmut Burge...
accept rate: 100%

edited 14.09.2015 at 10:33

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦

There is a sample implementation for an editable table in the 'Html Dialog Demos' project. This project is shipped with the Designer. See /applications/samples/HtmlDialogDemos

In your case the problem could be that you use p:inputText instead of h:inputText. But that's just one difference that popped into my eye when comparing the demo code with your code-snip.

hd demos screenshot


answered 14.09.2015 at 10:41

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
accept rate: 70%

This was missing: editable="true" editMode="cell" Then the cell could be edited.

(08.10.2015 at 10:57) Helmut Burge... Helmut%20Burgemeister's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 13.09.2015 at 01:59

Seen: 3,045 times

Last updated: 08.10.2015 at 10:57