On 4/5/10 4:28 PM, Joel Weight wrote:
> Sorry, forgot to mention, JSF 2.0.2-b10 on Glassfish V3.
>
> On Mon, Apr 5, 2010 at 5:27 PM, <webtier_at_javadesktop.org
> <mailto:webtier_at_javadesktop.org>> wrote:
>
> I have this form in a composite component
>
> <h:form id="loginForm" prependId="false" >
> <h:outputText value="#{cc.attrs.labelUsername}" />: <h:inputText
> id="j_username" value="#{cc.attrs.beanUser.username}"/><br/>
> <h:outputText value="#{cc.attrs.labelPassword}" />: <h:inputSecret
> id="j_password" value="#{cc.attrs.beanUser.password}"/><br />
> <h:commandButton type="submit" id="action"
> value="#{cc.attrs.labelLogin}" action="#{cc.attrs.action}" />
> </h:form>
>
> I would expect the various input IDs not to have the form's id
> prepended to them. This is the form that I get in my web browser.
>
> <form id="j_idt9:loginForm" name="j_idt9:loginForm" method="post"
> action="/comp/faces/test/login/testLogin.xhtml"
> enctype="application/x-www-form-urlencoded">
>
> <input type="hidden" name="j_idt9:loginForm"
> value="j_idt9:loginForm" />
> Username: <input id="[b]j_idt9:j_username[/b]" type="text"
> name="j_idt9:j_username" /><br />
> Password: <input id="[b]j_idt9:j_password[/b]" type="password"
> name="j_idt9:j_password" value="" /><br />
> <input id="j_idt9:action" type="submit" name="j_idt9:action"
> value="Submit" />
> <input type="hidden" name="javax.faces.ViewState"
> id="javax.faces.ViewState"
> value="3823458531816362878:8106158547383944399" autocomplete="off" />
> </form>
>
> Notice the incorrect ids for all controls in the form. Am I using
> prependId incorrectly, or is it broken?
>
The IDs are as they should be. One thing to keep in mind is that *all*
composite components are NamingContainers which means all components
within the composite component will inherit its ID. Setting prependId
on the form has no bearing here (and no, there is no way to disable the
ID behavior on composite components as you can with the form).
>
> Thanks,
> Joel
> [Message sent by forum member 'jweight']
>
> http://forums.java.net/jive/thread.jspa?messageID=395392
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> <mailto:webtier-unsubscribe_at_glassfish.dev.java.net>
> For additional commands, e-mail:
> webtier-help_at_glassfish.dev.java.net
> <mailto:webtier-help_at_glassfish.dev.java.net>
>
>