On Tue, Apr 8, 2008 at 8:03 PM, Jim Driscoll <Jim.Driscoll_at_sun.com> wrote:
> Thanks to Jason and Ryan for the comments. I've incorporated all comments
> (final strings, value expressions, and renderer) except the facelets tag
> descriptor - (I haven't worked with facelets before, and would like to put
> this back soon, rather than take a couple days to learn facelets. Hope
> that's ok. I need to also add facelet tags for the two validators I've
> written as well.)
>
I think this code may be problematic:
UIComponent parentComponent = component.getParent();
String parentID = parentComponent.getClientId(context);
String targetID = parentID+":"+forID;
That assumes that the component's parent is the form, but it may not be.
While it may not make sense to nest this in something other than h:form,
someone's bound to do it, and the "failure" of the component won't have an
obvious cause.
I think it would be better, also, to add a type="text/javascript" attribute
to the tag. In the JS, you call the method before you declare it. Does that
work? Doesn't seem like it would, but JS engines are kinda strange, so I
could be wrong. :P
--
Jason Lee, SCJP
Software Architect -- Objectstream, Inc.
Mojarra and Mojarra Scales Dev Team
https://mojarra.dev.java.net
https://scales.dev.java.net
http://blogs.steeplesoft.com