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

Anthony O. (JIRA) jira-events at lists.jboss.org
Mon Feb 7 10:50:40 EST 2011


    [ https://issues.jboss.org/browse/JBSEAM-2652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580502#comment-12580502 ] 

Anthony O. commented on JBSEAM-2652:
------------------------------------

There is no news about this ? Because in 2.2.0.GA that problem still exists, and this is not duplicated in JBSEAM-1572 ...
Should we open a new ticket ?

> s:decorate does not respect prependId="false" on h:form
> -------------------------------------------------------
>
>                 Key: JBSEAM-2652
>                 URL: https://issues.jboss.org/browse/JBSEAM-2652
>             Project: 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.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list