i got an edittable data table.
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<html>
<head>
<title></title>
</head>
<body>
<f:view>
<h:form>
<h:commandButton value="Test"></h:commandButton>
<rich:dataTable value="#{TreeBean.texte}" var="text" id="test"
onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
cellpadding="0" cellspacing="0" rows="4"
columnsWidth="100%" width="100%" border="0"
columns="1">
<f:facet name="header">
<rich:columnGroup>
<rich:column colspan="1">
<h:outputText value="Text" styleClass="toolbartext" />
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:column colspan="1">
<h:inputText value="#{text}" styleClass="outputtext_read}" />
</rich:column>
</rich:dataTable>
<h:inputText value="#{TreeBean.testtext}"></h:inputText>
</h:form>
</f:view>
</body>
</html>
String testtext="";
public String getTesttext() {
return testtext;
}
public void setTesttext(String testtext) {
if (cat.isDebugEnabled())
cat.debug("Set text =" + testtext);
this.testtext = testtext;
}
List<String> texte = new ArrayList();
public List getTexte() {
if ( texte.size() == 0) {
texte.add(new String("1"));
texte.add(new String("2"));
}
return texte;
}
public void setTexte(List texte) {
if (cat.isDebugEnabled())
cat.debug("set texte");
for (int i = 0; i < texte.size(); i++) {
if (cat.isDebugEnabled())
cat.debug( "Wert:" + (String)texte.get(i));
}
this.texte = texte;
}