<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to edit values in GUI in a datatable in JSF?</title><link>https://answers.axonivy.com/questions/1472/how-to-edit-values-in-gui-in-a-datatable-in-jsf</link><description>&lt;p&gt;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:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p:fieldset styleClass="emailSettingFieldset" legend="Materialkurztexte"  style="width: 30%;height:240px; text-align:right;margin-left: 600px; margin-top: -276px"&amp;gt;
    &amp;lt;div class="row"&amp;gt;
        &amp;lt;div class="col-md-12"&amp;gt;
            &amp;lt;p:dataTable id="kurzTexte" var="kurztext"
                value="#{data.materialStammData.materialkurztext}"
                editable="true" style="margin-bottom:0px"
                rowIndexVar="rowIndex" editingRow="true"&amp;gt;
                &amp;lt;p:ajax event="rowEdit" /&amp;gt;
                &amp;lt;p:ajax event="rowEditCancel" /&amp;gt;

                &amp;lt;p:column headerText="Sprache" style="width: 135px"&amp;gt;
                    &amp;lt;h:outputText value="#{kurztext.sprache}"
                        style="margin-left: 15px;" /&amp;gt;
                &amp;lt;/p:column&amp;gt;

                &amp;lt;p:column headerText="Kurztext"&amp;gt;
                    &amp;lt;p:cellEditor&amp;gt;
                        &amp;lt;f:facet name="output"&amp;gt;
                            &amp;lt;h:outputText value="#{kurztext.text}" /&amp;gt;
                        &amp;lt;/f:facet&amp;gt;
                        &amp;lt;f:facet name="input"&amp;gt;
                            &amp;lt;p:inputText value="#{kurztext.text}" style="width:97%"
                                label="KurztextEingabe" /&amp;gt;
                        &amp;lt;/f:facet&amp;gt;
                    &amp;lt;/p:cellEditor&amp;gt;
                &amp;lt;/p:column&amp;gt;

            &amp;lt;/p:dataTable&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/p:fieldset&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Kind regards,
Helmut&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1472/how-to-edit-values-in-gui-in-a-datatable-in-jsf" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 14 Sep 2015 10:41:48 -0400</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1472/how-to-edit-values-in-gui-in-a-datatable-in-jsf/1475</link><description>&lt;p&gt;There is a sample implementation for an editable table in the 'Html Dialog Demos' project. This project is shipped with the Designer. See &lt;code&gt;/applications/samples/HtmlDialogDemos&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In your case the problem could be that you use &lt;strong&gt;p:inputText&lt;/strong&gt; instead of &lt;strong&gt;h:inputText&lt;/strong&gt;. But that's just one difference that popped into my eye when comparing the demo code with your code-snip.&lt;/p&gt;
&lt;p&gt;&lt;img alt="hd demos screenshot" src="http://answers.axonivy.com/upfiles/editableTableDemo.PNG"&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Mon, 14 Sep 2015 10:41:48 -0400</pubDate><guid>https://answers.axonivy.com/questions/1472/how-to-edit-values-in-gui-in-a-datatable-in-jsf/1475</guid></item></channel></rss>