Unique Id generation aside, I think the qualm was with the 'jsp' prefix
in the generated IDs. I know that JSP 2.1 has the ability to assign ids
unique to a tag on a page, but that's different than what you are
describing.
Martin Marinschek wrote:
The problem is that there is a bug in the spec here.
If you called createUniqueId in earlier MyFaces versions, you would
receive a unique id, but only unique for one request. On the next
request, the sequence would be restarted. This would make working with
dynamic component creation exceptionally hard, if not impossible. On
subsequent requests, the sequence counter would'nt start anew, and
you'd get DuplicateIdExceptions all over!
To fix this, we went to be more inline with what JSF1.2 foresees for
id creation. JSF 1.2 wants the servlet container to create unique ids
- so we loose control about the ids produced, and createUniqueId is
never called. Note: when we all move to 1.2, you won't know about the
id-syntax anymore anyways - the servlet container provides the unique
ids then.
We implemented a partial solution of this - we have a separate counter
for JSP-tags; and those ids are produced out of a different sequence.
To make sure that the id's don't match, we prepend a "jsp" in front of
the actual unique id counter.
With this solution, we can store the current sequence counter of
createUniqueId between requests, and dynamic component creation is not
a problem anymore!
I wonder why you would need the component id to have a special syntax?
Do you rely in any way on this?
regards,
Martin
On 7/12/06, *Gary VanMatre* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
>From: "Matthias Wessendorf" <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>
>
> Hey Howard,
>
> you mean stuff like ?
>
>
>
> Was introduced in " Revision 359449"
>
> see
> http://svn.apache.org/viewvc?view=rev&revision=359449
<http://svn.apache.org/viewvc?view=rev&revision=359449>
>
> I can't tell you much about that. sorry!
>
I did some research on this for Shale Clay. Clay has to
conditionally decide to use the ViewRoot to create a unique id or
use another method. It looks like it has to do with partial page
rendering. I suspect it was added for ajax component support.
That's pretty much the same answer as Matthias.
> -Matt
Gary
>
> On 7/12/06, Abrams, Howard A wrote:
> >
> >
> >
> >
> > Hi,
> >
> >
> >
> > Is there any reason why the UIComponentTag appends "jsp" to all
the
> > component ids in 1.1.3/1.1.4? Any chance this can be removed
for 1.1.4 so
> > that it returns the same ids as UIViewRoot.createUniqueId() and
the RI?
> >
> >
> >
> > Thanks,
> >
> > h
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces
--
--------------------------
Sent from my FrankenBerry Wireless Handheld