Hy,
I have a problem with binding a h:dataTable to a backing bean. After
reloading I get the message:
09.04.2006 11:13:21 org.apache.myfaces.renderkit.html.HtmlRendererUtils
decodeUIInput
WARNUNG: There should always be a submitted value for an input if it is
rendered, its form is submitted, and it is not disabled or read-only.
If I am not binding the dataTable everything works well.
Here is the code (I am using MyFaces 1.1.1):
tableBinding.jsp:
<?xml version="1.0" encoding="ISO-8859-1"?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<jsp:directive.page language="java" contentType="text/html;
charset=ISO-8859-1"
pageEncoding="ISO-8859-1"/>
<html>
<head>
</head>
<body>
<f:view>
<h:form>
<!--Everything works well, when not using the binding
attribute-->
<h:dataTable binding="#{tableBinding.table}"
value="#{tableBinding.values}"
var="value">
<h:column>
<h:inputText value="#{value.value}" />
</h:column>
</h:dataTable>
<h:commandButton value="Submit"
action="#{tableBinding.reload}"></h:commandButton>
</h:form>
</f:view>
</body>
</html>
</jsp:root>
tableBinding.java:
import java.util.ArrayList;
import java.util.List;
import javax.faces.component.html.HtmlDataTable;
public class TableBinding {
HtmlDataTable uiData;
ArrayList list = new ArrayList();
public TableBinding() {
list.add(new Value("first"));
list.add(new Value("second"));
list.add(new Value("third"));
list.add(new Value("fourth"));
list.add(new Value("fifth"));
}
public String reload () {
return null;
}
public List getValues() {
return list;
}
public HtmlDataTable getTable() {
return uiData;
}
public void setTable(HtmlDataTable uiData) {
this.uiData = uiData;
}
//Helper Class
public class Value {
String value;
public Value(String s) {
value = s;
}
public String getValue() {
return value;
}
public void setValue(String s) {
value = s;
}
}
}
What I'm doing wrong?
Have much thanks for your help!!!!
Helmut