[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-2652) s:decorate does not respect prependId="false" on h:form

Pete Muir (JIRA) jira-events at lists.jboss.org
Tue Feb 19 07:15:26 EST 2008


     [ http://jira.jboss.com/jira/browse/JBSEAM-2652?page=all ]

Pete Muir closed JBSEAM-2652.
-----------------------------

    Resolution: Won't Fix

In fact, this is really partially a dupe of JBSEAM-1572, and partially a feature request for s:decorate to have a new attribute prependId. So I'm closing it.

> s:decorate does not respect prependId="false" on h:form
> -------------------------------------------------------
>
>                 Key: JBSEAM-2652
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2652
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: JSF Controls
>    Affects Versions: 2.0.1.GA
>         Environment: JBoss Seam 2.0.1GA
>            Reporter: Erik Magnusson
>
> Given the following code:
> <h:form id="login" prependId="false">
> 	<s:validateAll>
>             <f:facet name="afterInvalidField">            
>             	<s:label styleClass="error">
>             		<s:message/>
>             	</s:label>
>             </f:facet>
>             <div class="labelinputcombo ilcblock">  
>                 <h:outputLabel for="username">User name:</h:outputLabel>               		
>                 <s:decorate>
>                 	<h:inputText id="username" value="#{registrationService.newUser.userName}" required="true"/>                   	              	                	
>                 </s:decorate>
>             </div>
>          </s:validateAll> 
>          <div>
>             <h:commandButton value="Register" action="#{registrationService.registerUser}"/>
>          </div>
> </h:form>
> One would expect that none of the generated <input> elements would have prepended IDs, since the h:form has prependId="false". However, since s:decorate insists on inserting a superfluous <div> with a generated ID around the <input> elements it surrounds, those <input> elements end up having prepended IDs from that <div>. The relevant generated HTML:
> <div class="labelinputcombo ilcblock">
>   <label for="j_id31:username">User name:</label><div id="j_id31"><input id="j_id31:username" type="text" name="j_id31:username" /></div>
> </div>
> I did not ask for either the <div> or it's ID (<div id="j_id31">), or its insertion into my <input> element's ID (id="j_id31:username").
> Proposed solutions:
> 1. Remove the generated <div>. Is it really necessary for the functionality of s:decorate? If I want a div I can always add it myself.
> 2. If the <div> really is necessary, at least make s:decorate respect the prependId="false" attribute of the surrounding h:form.
> 3. If that is not possible, as a last resort, introduce a prependId attribute on the <s:decorate> tag so we can at least force this behaviour if we want it.
> On a more general note, 
> I'm a really big fan of the JSF-Seam-EJB3 combo, but some of the design decisions in the frameworks are baffling. Why so many superfluous generated html tags? And who thought of the bright idea of prepending element id attributes using : (colon) as the delimeter?? This effectively cripples the ability to use CSS to style JSF-generated HTML elements with a simple CSS id selector (since : is a reserved symbol in CSS).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list