myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TobiTobsen <>
Subject DataTable with Inputfields Problem
Date Mon, 07 May 2007 14:48:37 GMT

I write a program which should show Data in a Table and the user should be
able to edit them.
The Table has to be generated dynamicaly. For simplicity I create a table
with 2 cols und 2 rows. When I run the application there appears a problem.
The valueChanged - Method is just called when I change the value of one of
the two fields in the first column.
Why isnt the Method called when I change the value of a field of the second

My jsp-File looks as followed:
<%@ taglib uri="" prefix="f" %>
<%@ taglib uri="" prefix="h" %>
<%@ taglib uri="" prefix="t" %>

		<title>Vitax Web 1.0</title>
		<h:form id="taxForm">
    		<t:dataTable id="taxTable" var="row" value="#{taxTable.tableModel}">
    			<t:columns value="#{taxTable.columnModel}" var="col">
    				<f:facet name="header">
    					<h:outputText value="#{col}" />
				<t:inputText id="in" value="#{row[taxTable.columnModel.rowIndex]}"
					valueChangeListener="#{taxTable.valueChanged}" immediate="true"   

Here is the code for the taxTable SessionBean:
public class TaxTable {
	private javax.faces.model.ListDataModel tableModel;
	private javax.faces.model.ListDataModel columnModel;
	public SessionBean() {

	public void valueChanged(ValueChangeEvent evt) {
		System.out.println("Old Value: "+evt.getOldValue().toString());
		System.out.println("New Value: "+evt.getNewValue().toString());

	public javax.faces.model.ListDataModel getTableModel() {
		if(tableModel == null) {
			Object[] o1 = new Object[] {"Zeile 1", new Integer(1)};
			Object[] o2 = new Object[] {"", new Integer(2)};
			List<Object[]> l = new ArrayList<Object[]>();
			tableModel = new ListDataModel(l);
		return tableModel;

	public void setTableModel(javax.faces.model.ListDataModel tableModel) {
		this.tableModel = tableModel;

	public javax.faces.model.ListDataModel getColumnModel() {
		if(columnModel == null) {
			String[] o1 = new String[] {"Spalte1", "Spalte2"};
			List<String> l = new ArrayList<String>();
			columnModel = new ListDataModel(l);
		return columnModel;

	public void setColumnModel(javax.faces.model.ListDataModel columnModel) {
		this.columnModel = columnModel;

Please help me.

View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message