Skip to Content
0
Former Member
May 05, 2006 at 07:51 PM

Rettriving changed data from <hbj:TableView>

29 Views

Hi,

I have created a TableView, with 10 rows and 3 columns. All these fields are Input Fields, as set inside the TableViewBean. I am having problems retrieving the data from the JSP.

Here is the code for the TableViewBean model creation:

public void setModel(String[][] table) {
	String[] colNames = { "Username", "CostCentreGroup", "ReadWriteAccess" };
	model = new DefaultTableViewModel(table, colNames);
	
	model.setKeyColumn(1);
	
	TableColumn column = model.getColumn("Username");
	column.setTitle("Username");
	column.setType(TableColumnType.INPUT);
	
	column = model.getColumn("CostCentreGroup");
	column.setTitle("Cost Centre/Group"); 
	column.setType(TableColumnType.INPUT);
	
	column = model.getColumn("ReadWriteAccess");
	column.setTitle("Read/Write Access");
	column.setType(TableColumnType.INPUT);
	setExtab(table);
}

Here is the code for the JSP:

 <hbj:tableView
	id="myTableViewAdd"
	model="tvaBean.model"
	design="ALTERNATING"
	headerVisible="TRUE"
	footerVisible="TRUE"
	fillUpEmptyRows="TRUE"
	navigationMode="BYPAGE"
	selectionMode="NONE"
	visibleRowCount="10">
	 <% myTableViewAdd.useRowSelection(tvaBean.getOldTableView()); %>
</hbj:tableView>
<hbj:button
	id="add"
	text="Add Exception"
	onClick="onAddTableRows" />

Inside the Java, I have tried to retrieve the data that I enter on the screen, but I keep getting null pointer errors. When I retrieve the model from the bean, I get information, but just the old table, not the one that I had just modified on the screen.

I hope this is clearer than mud...

Cheers,

Kevin