webtier@glassfish.java.net

c:forEach creates inconsistent behaviour with components with id

From: <forums_at_java.net>
Date: Thu, 23 Aug 2012 10:54:16 -0500 (CDT)

Hello, Mojarra 2.1.12 Primefaces 3.4-RC1 If have a c:forEach statement : -
"#{component.components}" contains more than one element. - A parent of
"c:forEach" contains a binding. - All ui:include contain differents jsf
fragment with a form and an id attribute The use case is the following. 1)
The user loads the page : - ForEachHandler.apply calls
"ComponentSupport.setNeedUniqueIds(ctx, true)" so children's id are generated
even if forEach's children contain id. -
"ComponentTagHandlerDelegateImpl.apply" creates the children's components
with a generated id. 2) The user clicks on an ajax link : - The
javax.faces.source is a generated id - the restore view phase is executed -
Because of the bidding, components already exists.
"ComponentTagHandlerDelegateImpl.apply" finds the component, calls
"ComponentTagHandlerDelegateImpl.doExistingComponentActions" which erases the
generated id with the id set as attribute. => There is a mismatch between the
javax.faces.source id and the id inside the tree => The action handler is
never fired Is this a bug? Or my use case is a bad use of jsf? Why c:forEach
generates id even when id attribute is set? If there is a duplicated id
exception, does it not the developer responsability to resolve this case ?
Thanks, Nicolas

--
[Message sent by forum member 'nithril']
View Post: http://forums.java.net/node/889500