• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Duplicate ID error on JSF Page

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Kapil Raina
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic