Duplicate view state id

UI Components for JSF
Post Reply
User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

29 Jul 2011, 22:27

It appears the JSF spec has an oversight where it requires a hidden field embedded in each form with an id="javax.faces.ViewState". This obviously isn't going to be unique if you have more than one form on your page (which is not that uncommon). Of course, ids are supposed to be unique per page.

Mojarra has a context param that allows you to omit the id (com.sun.faces.enableViewStateIdRendering). However, disabling the views state id rendering may have bad consequences if PrimeFaces expects the id to be there. So, I'm hoping PrimeFaces doesn't rely on that id, but I'd appreciate confirmation that it doesn't.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Jul 2011, 11:57

PrimeFaces uses name attribute instead of id so it should be safe.

User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

01 Aug 2011, 14:05

That's great to hear. Thanks. I hope the spec is updated soon so that implementation specific workarounds won't be necessary in the future.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 39 guests