[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4428) <s:decorate> tag gives a "[renderkit] 'for' attribute cannot be null" message when no EditableValueHolder is found
by Julien Kronegg (JIRA)
<s:decorate> tag gives a "[renderkit] 'for' attribute cannot be null" message when no EditableValueHolder is found
------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-4428
URL: https://jira.jboss.org/jira/browse/JBSEAM-4428
Project: Seam
Issue Type: Bug
Affects Versions: 2.1.2.GA
Environment: Seam 2.1.2.GA, http://fisheye.jboss.org/browse/Seam/branches/community/Seam_2_1/ui/src/m..., http://fisheye.jboss.org/browse/Seam/branches/community/Seam_2_1/ui/src/m...
Reporter: Julien Kronegg
Priority: Minor
When a field is decorated using <s:decorate> with the default Seam template "edit.xhtml" on content without EditableValueHolder (i.e. editable elements such as <h:inputText>), the following warning is issued:
WARN [renderkit] 'for' attribute cannot be null
This occurs for example on the following code snippet:
<s:decorate id="char" template="edit.xhtml">
<ui:define name="label">Characters Left:</ui:define>
<h:outputText id="charLeft" value="#{smsClass.charLeft}"/>
</s:decorate>
The Seam edit.xhtml template is the following:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib">
<div class="prop">
<s:label styleClass="name #{invalid?'errors':''}">
<ui:insert name="label"/>
<s:span styleClass="required" rendered="#{required}">*</s:span>
</s:label>
<span class="value #{invalid?'errors':''}">
<s:validateAll>
<ui:insert/>
</s:validateAll>
</span>
<span class="error">
<h:graphicImage value="/img/error.gif" rendered="#{invalid}" styleClass="errors"/>
<s:message styleClass="errors"/>
</span>
</div>
</ui:composition>
This is caused by org.jboss.seam.ui.component.UIDecorate which gets the 'for' id by looking at the first available EditableValueHolder. When there is no such element, the 'for' id is null, hence the warning message (probably issued by the org.jboss.seam.ui.component.UIMessage parent class javax.faces.component.html.HtmlMessage).
The warning message is very anonying and give no useful information on what is going wrong: this kind of messages takes a lot of time to track and makes a big impact on the developper productivity.
The UIDecorate class should either:
1) display no error message (by either attaching the s:message tag to the s:decorate itself, or by avoid rendering the s:message)
2) display a more meaningfull message such as "No editable component found to attach the message in the decorate with id=xxx" (maybe to be combined with solution 1).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months