myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Marinschek" <martin.marinsc...@gmail.com>
Subject Re: Ids in 1.1.3 and 1.1.4
Date Thu, 13 Jul 2006 05:45:59 GMT
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 <gvanmatre@comcast.net> wrote:
>
> >From: "Matthias Wessendorf" <matzew@apache.org>
>
> >
> > Hey Howard,
> >
> > you mean stuff like ?
> >
> >
>
>
> >
>
> > Was introduced in "Revision 359449"
> >
> > see
> > 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 wasadded 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.4so
> > > 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

Mime
View raw message