You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Beelen, Marco" <ma...@merck.com> on 2007/03/01 10:13:35 UTC

RE: [Solved] Never before seen exception ( facelets.FaceletViewHandler handleRenderException) - ??

Hello,

Like Lisa I've run into some duplicateId exceptions also and I'm using
facelets.
The cause for my problems is that in the application a user can perform
some action on one page ( enter search criteria ) and the resuls gets
rendered on the same page. ( Results become h:commandLinks in a
t:dataTable.

On the first hit all components get a generated id like with _idxxx
where xxx is a number counting upwards, but it skips some numbers. 

On the second hit all components already present still have their old
id, but for the new components ( the links in the resultset ) the
id-generation starts all over again with _id1 can counting upwards
again.

If there happens to be an 'old' component with a certain ID then a
DuplicateId-exception will occur.

I can work around the problem by manually assigning id's to all 'static'
components on the pages. 

I'm not in to the internals of MyFaces (yet), so forgive for any stupid
suggestions, but isn't it possible to have the id-generator inspect the
component tree after the RESTORE_VIEW and the id-counter could start
counting from the max( id ) + 1.
Or if this might affect the performance of the application: Store a
requestCounter in SessionScope and prefix all generated id's with the
current requestCounter, which would ensure that the id's generated for
the second request of a page will not match the id's of the first
request.

In my app im using Facelets ui:include quite other, which allows me to
build reusable components and including them on the actual page. I think
most of my duplicateID-exceptions would not occur if every ui:include
would automatically imply a f:subview, but this possible solution would
have to be implemented in Facelets and not by MyFaces Tomahaw.


With kind regards,
  Marco Beelen









-----Original Message-----
From: Shane Petroff [mailto:shane@mayet.ca] 
Sent: woensdag 28 februari 2007 19:54
To: MyFaces Discussion
Subject: Re: [Solved] Never before seen exception (
facelets.FaceletViewHandler handleRenderException) - ??

Lisa wrote:
> I checked everywhere, even grep'd through everything and there is no
> conflict.  Any ideas would be appreciated.
>   
I thought I was the only one seeing misidentified 'duplicate ids' (I 
don't use facelets though, so this could be worthless advice). 
Invariably for me, 'duplicate id' has been a red herring. It seems that 
this can happen when there is some malformed EL squirreled away 
somewhere. But to be honest, I haven't really noticed enough of a 
pattern to be terribly certain.

-- 
Shane




------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is 
available at http://www.merck.com/contact/contacts.html) that may be 
confidential, proprietary copyrighted and/or legally privileged. It is 
intended solely for the use of the individual or entity named on this 
message. If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then 
delete it from your system.

------------------------------------------------------------------------------

Re: [Solved] Never before seen exception ( facelets.FaceletViewHandler handleRenderException) - ??

Posted by Mike Kienenberger <mk...@gmail.com>.
What version of facelets are you using?  I don't see this behavior and
I do the same thing (have search criteria on a page, then add the
results to the page after the search is performed).

I don't have any problems with subviews and includes.

<f:subview id="pendingServiceOrderSubview">
    <ui:include src="/pages/fragment/serviceOrderListOutput.xhtml">
        <ui:param
            name="serviceOrderList"
            value="#{accountDetailPage.currentAccount.pendingServiceOrderList}"/>
        <ui:param
            name="showOnMultipleLines"
            value="true"/>
    </ui:include>
</f:subview>

If it's a matter of not wanting to manually create the subview and
include all the time, create a templated component:


<my:serviceOrderListOutput
    subviewId="pendingServiceOrderSubview"
    serviceOrderList="#{accountDetailPage.currentAccount.pendingServiceOrderList}"
    showOnMultipleLines="true" />

This is probably a cleaner way to do it anyway.


On 3/1/07, Beelen, Marco <ma...@merck.com> wrote:
> Hello,
>
> Like Lisa I've run into some duplicateId exceptions also and I'm using
> facelets.
> The cause for my problems is that in the application a user can perform
> some action on one page ( enter search criteria ) and the resuls gets
> rendered on the same page. ( Results become h:commandLinks in a
> t:dataTable.
>
> On the first hit all components get a generated id like with _idxxx
> where xxx is a number counting upwards, but it skips some numbers.
>
> On the second hit all components already present still have their old
> id, but for the new components ( the links in the resultset ) the
> id-generation starts all over again with _id1 can counting upwards
> again.
>
> If there happens to be an 'old' component with a certain ID then a
> DuplicateId-exception will occur.
>
> I can work around the problem by manually assigning id's to all 'static'
> components on the pages.
>
> I'm not in to the internals of MyFaces (yet), so forgive for any stupid
> suggestions, but isn't it possible to have the id-generator inspect the
> component tree after the RESTORE_VIEW and the id-counter could start
> counting from the max( id ) + 1.
> Or if this might affect the performance of the application: Store a
> requestCounter in SessionScope and prefix all generated id's with the
> current requestCounter, which would ensure that the id's generated for
> the second request of a page will not match the id's of the first
> request.
>
> In my app im using Facelets ui:include quite other, which allows me to
> build reusable components and including them on the actual page. I think
> most of my duplicateID-exceptions would not occur if every ui:include
> would automatically imply a f:subview, but this possible solution would
> have to be implemented in Facelets and not by MyFaces Tomahaw.
>
>
> With kind regards,
>   Marco Beelen
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Shane Petroff [mailto:shane@mayet.ca]
> Sent: woensdag 28 februari 2007 19:54
> To: MyFaces Discussion
> Subject: Re: [Solved] Never before seen exception (
> facelets.FaceletViewHandler handleRenderException) - ??
>
> Lisa wrote:
> > I checked everywhere, even grep'd through everything and there is no
> > conflict.  Any ideas would be appreciated.
> >
> I thought I was the only one seeing misidentified 'duplicate ids' (I
> don't use facelets though, so this could be worthless advice).
> Invariably for me, 'duplicate id' has been a red herring. It seems that
> this can happen when there is some malformed EL squirreled away
> somewhere. But to be honest, I haven't really noticed enough of a
> pattern to be terribly certain.
>
> --
> Shane
>
>
>
>
> ------------------------------------------------------------------------------
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
> New Jersey, USA 08889), and/or its affiliates (which may be known
> outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
> and in Japan, as Banyu - direct contact information for affiliates is
> available at http://www.merck.com/contact/contacts.html) that may be
> confidential, proprietary copyrighted and/or legally privileged. It is
> intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and then
> delete it from your system.
>
> ------------------------------------------------------------------------------
>