Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The actual code does several other processing, but below code should help in replicating the issue. In the below code, I expect the TestString to output the modified values from the page. But it just returns old values. Below is the jsp:</p> <pre><code>&lt;%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%&gt; &lt;%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;f:view&gt; &lt;body&gt; &lt;h:form styleClass="form" id="form1"&gt; &lt;h:commandButton value="Save" action="#{TestPageBackingBean.save}" styleClass="commandExButton"/&gt; &lt;h:outputText styleClass="label" value="Header Table"/&gt; &lt;h:dataTable binding="#{TestPageBackingBean.headerDataTable}"&gt;&lt;/h:dataTable&gt; &lt;/h:form&gt; &lt;/body&gt; &lt;/f:view&gt; &lt;/html&gt; </code></pre> <p>Below is the faces config:</p> <pre><code>&lt;managed-bean&gt; &lt;managed-bean-name&gt;TestPageBackingBean&lt;/managed-bean-name&gt; &lt;managed-bean-class&gt;test.jsf.TestPageBackingBean&lt;/managed-bean-class&gt; &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt; &lt;/managed-bean&gt; </code></pre> <p>Below is the backing bean code:</p> <pre><code>package test.jsf; import java.io.IOException; import javax.faces.component.UIColumn; import javax.faces.component.UIData; import javax.faces.component.UIInput; import javax.faces.component.UIOutput; import javax.faces.context.FacesContext; public class TestPageBackingBean { private UIData headerDataTable = new UIData(); public TestPageBackingBean() { } public UIData getHeaderDataTable() { return getHeaderTable(headerDataTable); } public UIData getHeaderTable(UIData dataTable) { for (int i=0;i&lt;10;++i) { dataTable.getChildren().add(getColumn(i)); } return dataTable; } private UIColumn getColumn(int i) { UIOutput outputLabelText = new UIOutput(); UIInput inputFieldText = new UIInput(); UIColumn column = new UIColumn(); outputLabelText.setValue("Label" + i); inputFieldText.setValue("test input" + i); column.setHeader(outputLabelText); column.setFooter(inputFieldText); return column; } public String save() throws IOException { String TestString = ""; FacesContext ctx = FacesContext.getCurrentInstance(); if (!ctx.getResponseComplete()) { for (int i=0; i&lt;headerDataTable.getChildren().size();++i) { TestString = TestString + (String)((UIInput)((UIColumn) headerDataTable.getChildren().get(i)).getFooter()).getValue(); } System.out.println(TestString); } return "save"; } public void setHeaderDataTable(UIData headerDataTable) { this.headerDataTable = headerDataTable; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload