| Author |
Duplicate ID error on JSF Page
|
Kapil Raina
Greenhorn
Joined: Oct 22, 2010
Posts: 2
|
|
Hi,
I know this has been debated on the forums before, but I am kind of not convinced about it.
I use scriptlets in JSF page for a looping over a collection and I have to manually assign ids to the components over each iteration. I know , I could have used a data table , but somehow the HTML mocks that were given didnt have the datatable compatible structure. So I had to loop over the data manually
Both of these approaches dont work.
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14456
|
|
Welcome to the JavaRanch, Kapil!
Don't use scriptlets. We'll help you setup DataTable to do what you want.
JSF views are not logic - they're 2-dimensional maps of a webpage, so when people attempt to make them do linear things, trouble often follows.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Kapil Raina
Greenhorn
Joined: Oct 22, 2010
Posts: 2
|
|
|
Thanks Tim! Yeah I know exactly what you are saying , but there is this divide being designers who write HTML and the ones who have to write JSF for the same. Changing the core HTML structure from a <DIV> to a <TABLE> based structure is a big deal right now. ( I have corrected the HTML mocks for a fresh project , having learnt from this nightmare!!). I am desparately trying to get the duplicate ID issue , so that I let the release of code and of course when people see something working , they give you some space to clean up stuff. But delivery first is what it is all about.
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14456
|
|
Well, a well-designed JSF page doesn't generally need any HTML and (well-designed or not), I have quite a substantial number of pages that demonstrate that over the years.
JSF is supposed to be an abstract framework, which is why it has plug-in renderers instead of just spitting out HTML directly the way JSP tags do. Putting in HTML on a JSF View is akin to breaking out into assembly language in the middle of a C program.
Whether the JSF renderer emits a table or a div is up to it, and there are JSF tags that actually do make div/span/table decisions. But worrying about which HTML element comes out is like worrying about what bytecodes were produced in the backing beans.
|
 |
 |
|
|
subject: Duplicate ID error on JSF Page
|
|
|