-
1. Re: Warning when using Seam FacesMessages and the h:messages tag
dhinojosa Sep 14, 2008 12:30 AM (in response to norad2)I believe that
<h:messages globalOnly="true"/>
will serve you well.
-
2. Re: Warning when using Seam FacesMessages and the h:messages tag
norad2 Sep 16, 2008 7:16 PM (in response to norad2)I've tried both ways and the warning is thrown with and without the globalOnly attribute.
-
3. Re: Warning when using Seam FacesMessages and the h:messages tag
olegnovikov Oct 16, 2008 10:30 AM (in response to norad2)It was another reason for "'for' attribute cannot be null" by me:
<s:decorate id="orderStatusDecoration" template="layout/edit.xhtml"> <ui:define name="label">Order status:</ui:define> <h:inputText id="os1" value="not requested" rendered="#{travelHome.instance.orderStatus.equals('1')}"/> <h:inputText id="os2" value="requested" rendered="#{travelHome.instance.orderStatus.equals('2')}"/></s:decorate>
if orderStatus was neither 1 nor 2, it was nothing to render within template as a second element.
The message "'for' attribute cannot be null" is disappeared, as i have added the third line inputText as follows:
<s:decorate id="orderStatusDecoration" template="layout/edit.xhtml"> <ui:define name="label">Order status:</ui:define> <h:inputText id="os1" value="not requested" rendered="#{travelHome.instance.orderStatus.equals('1')}"/> <h:inputText id="os2" value="requested" rendered="#{travelHome.instance.orderStatus.equals('2')}"/> <h:inputText id="os3" value="" rendered="#{empty travelHome.instance.orderStatus}"/></s:decorate>
That assured (in my example only, where orderStatus is '' or 1 or 2 only), that the second element of the template always exists. And the annoying "'for' attribute cannot be null" is gone ;-)
-
4. Re: Warning when using Seam FacesMessages and the h:messages tag
jkronegg Aug 18, 2009 10:14 PM (in response to norad2)We had the same issue as Oleg with the following code:
<s:decorate id="fieldDecoratorId" template="layout/edit.xhtml"> <ui:define name="label">Field Name</ui:define> <h:outputText id="fieldId" value="#{myBean.myValue}" /> </s:decorate>
Short story: the error was on our side: the template name to use is display.xhtml and not edit.xhtml, since the included element is not an input field.Long story: the edit.xhtml template has a <s:validateAll> tag which recursively looks for EditableValueHolder in included children. Since the <h:outputText> is not an EditableValueHolder, there is nothing to validate. This is the same cause as for Oleg's case when there was no <h:inputText>.
While this is not clearly a bug, the <s:validateAll> tag may issue a warning if there is nothing to validate. Worth a feature request on JIRA? I'm not sure...
-
5. Re: Warning when using Seam FacesMessages and the h:messages tag
jkronegg Aug 18, 2009 11:27 PM (in response to norad2)Oops, it is a bit more complex than that, see my comment in WARNRenderkitForAttributeCannotBeNull