• Post Reply Bookmark Topic Watch Topic
  • New Topic

Logic Iteraot in JSF

 
Manohar Chhapolia
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need a logic:iterator equivalent tag in JSF.

Thanks in advance

Regards,
Manohar
 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You won't find it.

JSF is designed for view presentation, and views shouldn't contain logic - that's what controllers are for in the MVC paradigm.

The most common need for iterators on web pages is for datatable displays, and JSF provides a datatable control that handles the iteration automatically in its controller.

JSF is a lot different than its predecessors, and this causes a lot of confusion. As programmers, we tend to think early about the "how" of things. In JSF, it's more important to think about the "what". So many common functions are part of the standard JSF toolkit that you can often find a simple solution by concentrating on the end result and then looking for something pre-existing that does that.
 
Manohar Chhapolia
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tom,

Actually, I need to iterate through a List of list in my dataTable.

Regards,
Manohar
 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try nesting datatables.

Although you'd need to construct a separate datamodel for each sub-table. This isn't quite as bad as it sounds, since you don't copy the data, just references to the data.

You might also want to look at some of the third-party JSF libraries. I think that RichFaces has a multi-level table control.
[ April 18, 2008: Message edited by: Tim Holloway ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!