building problem with dynamic dataTable
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
building problem with dynamic dataTable  XML
Forum Index -> Components
Author Message
Cyrill

Joined: 13/04/2007 00:00:00
Messages: 69
Offline


Hi all,

I'm trying to build a dynamic dataTable in a backingbean. The problem is that it shows only one row of three. The frist listings shows my jsf and the second the backing bean.

Code:
 			<ice:form>
 				<ice:panelGroup>
 					<ice:panelTabSet binding="#{tabletab.panelTabs}"/>									
 				</ice:panelGroup>			
 			</ice:form>
 


Code:
 	private void initTable() {
 		// Set rows. This is a stub example, just do your dynamic thing.
 		String[] row1 = { "ID1", "Name1", "Value1" };
 		String[] row2 = { "ID2", "Name2", "Value2" };
 		String[] row3 = { "ID3", "Name3", "Value3" };
 
 		// Convert rows to List and set the List.
 		myList = new ArrayList();
 		myList.add(Arrays.asList(row1));
 		myList.add(Arrays.asList(row2));
 		myList.add(Arrays.asList(row3));	
 
                 rowModel = new ListDataModel(myList);
 
 		table = new HtmlDataTable();
 		table.setVar("myItem");
 		table.setValue(rowModel);
 		
 		int tmpi = 0;
 
 		for (int i = 0; i < 3; i++) {
 
 			// Set header
 			UIOutput header = new UIOutput();
 			header.setValue("HEADER " + i);
 
 			// Set output
 			UIOutput output = new UIOutput();
 			ValueBinding myItem = FacesContext.getCurrentInstance()
 					.getApplication()
 					.createValueBinding("#{myItem[" + i + "]}");
 			output.setValueBinding("value", myItem);			
 
 			// Set output
 			UIColumn c = new UIColumn();
 			c.setHeader(header);
 			c.getChildren().add(output);
 
 			table.getChildren().add(c);
 		}
 		getChildren().add(table);
 	}
 


I don't get any errors or infos in the log.

Version:

ICEsoft Technologies, Inc.
ICEfaces 1.6.0
Build number: 15
Revision: 14409


Does anyone know what is wrong in my code sample?

regards

Cyrill
nicograf

Joined: 02/08/2007 00:00:00
Messages: 11
Offline


Hi,

I have exact the same Problem but no workaround for that.

nico
Cyrill

Joined: 13/04/2007 00:00:00
Messages: 69
Offline


nicograf wrote:
Hi,

I have exact the same Problem but no workaround for that.

nico 


I haven't found one until now.

There's a similar forum topic open -> http://www.icefaces.org/JForum/posts/list/5344.page . But also no solution or workaround.

regards

Cyrill
Baleyba

Joined: 16/11/2006 00:00:00
Messages: 110
Offline


Hi, I have the same problem.

We didn't find any solution.. :( The problem exists again into the new 1.6.1 version.

I think we should post this bug into the ICEFaces JIRA.

regards,
Bal.

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
Cyrill

Joined: 13/04/2007 00:00:00
Messages: 69
Offline


I opened one. -> http://jira.icefaces.org/browse/ICE-2077
Baleyba

Joined: 16/11/2006 00:00:00
Messages: 110
Offline


Hi Cyrill!

Thanks a lot!

Please vote for solving this issue ;)

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
michael.thiem


Joined: 04/06/2007 00:00:00
Messages: 704
Offline


Hi,

I don't think this is a problem with ICEfaces. Please also set the id's of the
components you are trying to add, like:

Code:
    table.setId("tableId");
 
    ...
    header.setId("header" +i);
 
    ...
    output.setId("output"+i);
 
    ...
    c.setId("column" + i);
 


I could reproduce the behaviour you described when I omitted the
component's id's. Please try this and tell me if it works. If the problem's
still the same I can provide with you a working test case.

Thanks,
Michael
Baleyba

Joined: 16/11/2006 00:00:00
Messages: 110
Offline


It works for me !

Thanks a lot michael.thiem

Best regards
Bal.

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
Cyrill

Joined: 13/04/2007 00:00:00
Messages: 69
Offline


Hi...

Thanks a lot ... Yes it works perfect for me as well :)

At this point I have a question to the id value.

Can you recommend to use createUniqueId for such an issue?

Code:
FacesContext.getCurrentInstance().getViewRoot().createUniqueId();


thanks again & regards

Cyrill

michael.thiem


Joined: 04/06/2007 00:00:00
Messages: 704
Offline


Hi,

I wouldn't recommend to use

Code:
FacesContext.getCurrentInstance().getViewRoot().createUniqueId();


since this often causes duplicate id's to be generated by the JSF
framework what might result in unforseen rendering behaviour. This is a
common problem and it is adviced to avoid the use of the createUniqueId()
method.

The easiest way is to generate a custom id (as showed in the test
case below) to avoid duplicate id problems.

Best regards,
Michael
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team