If you have a very simple example that shows this problem, please post it so we can work on a solution. Unfortunately my setup that breaks is fairly large.
-- Jon
On Apr 22, 2005, at 4:15 PM, Rob Decker wrote:
I've seen that exception with the verbatim tag as well. It was one of the
reasons I started stripping out jsp/html code.
In my opinion, release software shouldn't be throwing out fatal exceptions
like these two examples.
Specifying ID's everywhere will not help all that much. If the component
tree gets too big and complex, things start breaking. Code like this is not
designed to handle it and the fact that it's throwing an exception with a
misleading message to mask an earlier blunder is just an indication of
what's underneath it.
This code needs to be fixed if myfaces is going to move forward to handle
real world application development. The application I'm writing is really
simple from the UI perspective. I shouldn't be having this much trouble with
it. Personally I think software marketeers should tag there 1.x releases as
betas just to show a little honesty and integrity.
----- Original Message ----- From: "Jon Travis" <[EMAIL PROTECTED]> To: "MyFaces Discussion" <[email protected]> Sent: Friday, April 22, 2005 6:40 PM Subject: Re: duplicate ids
Seems as though there are more problems with that method than just the one you're pointing out (may be related, though).
I have a verbatim tag that actually blows up with a ClassCastException in the doEndTag when trying to cast to a UIOutput.
Since the component type is defined to be javax.faces.Output, you'd expect that this would always succeed.
Unfortunately, in the UIComponentTag, findComponent() does:
_componentInstance = parent.findComponent(id)
which (in my case) happens to return a panel grid.
Note, I'm not specifying any IDs in any of my tags. It appears that if you want to be safely using myfaces, you'll have to be specifying IDs everywhere.
-- Jon
On Apr 22, 2005, at 8:32 AM, Rob Decker wrote:
I'm looking over the UIComponentTag.findComponent(id) method where
this "problem with
duplicate ids" exception is thrown. This code doesn't even check to
see if the id is a
duplicate. It simply checks if more children were added to the parent
than the size of
the list of children the parent has. The component in question isn't
one of the
children because just prior to (and the reason for) executing the code
that throws
this exception was that the id wasn't found as a child of the
component.
The issue here is that sometime earlier the code lost track of the count of siblings and this exception only masks that bug. The comments don't give a reason for adding this index check but there is a comment about it:
* Revision 1.16 2004/04/20 10:54:21 royalts * added index check to findComponent
Does anyone have any info on this?
-- Rob
@objectsource.org

