You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by ch...@globus.ch on 2004/11/18 09:09:52 UTC

x:message tag

Hi there,

I played around with the messages tag. I realised, that it is not possible 
to set a x:message tag 
before the input tag which it is referencing to. Like this:

<x:message for="rayon" detailFormat="*" styleClass="ErrorText" />
<h:inputText id="rayon" styleClass="FieldForm NormalText TextLeftAlign" 
value="#{WVSForm.a_WVSObject.a_Rayon}">
  <f:validateLongRange minimum="0" maximum="9999"/>
</h:inputText>

Error: Can't find Component"rayon"

It works if I set the x:message tag after the input tag:

<h:inputText id="rayon" styleClass="FieldForm NormalText TextLeftAlign" 
value="#{WVSForm.a_WVSObject.a_Rayon}">
  <f:validateLongRange minimum="0" maximum="9999"/>
</h:inputText>
<x:message for="rayon" detailFormat="*" styleClass="ErrorText" />


But on the other hand, in the x:dataTable it doesen't matter. both 

<h:column >
        <x:message for="skunbr" detailFormat="*" styleClass="ErrorText" />
        <h:inputText id="skunbr" value="#{sku.a_Skunbr}" required="true" >
          <f:validateLength minimum="8" maximum="8" />
        </h:inputText>
 </h:column>

and

<h:column >
        <h:inputText id="skunbr" value="#{sku.a_Skunbr}" required="true" >
          <f:validateLength minimum="8" maximum="8" />
        </h:inputText>
        <x:message for="skunbr" detailFormat="*" styleClass="ErrorText" />
</h:column>

work perfectly.

Now my question is: Is this correct or is this a remaining bug?

greetz,

 Chris

RE: message tag

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Chris,
 
this is generell in JSF (see [Bergsten] )
 
the component tree does not know a component with ID=rayon,
when I comes first to <x:message/>.
 
 
Bergsten: http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html
 
 
 
-Matthias 
 
 -----Original Message-----
From: christian.rueedi@globus.ch [mailto:christian.rueedi@globus.ch] 
Sent: Thursday, November 18, 2004 9:10 AM
To: MyFaces Discussion
Subject: x:message tag




Hi there, 

I played around with the messages tag. I realised, that it is not
possible to set a x:message tag 
before the input tag which it is referencing to. Like this: 

<x:message for="rayon" detailFormat="*" styleClass="ErrorText" /> 
<h:inputText id="rayon" styleClass="FieldForm NormalText TextLeftAlign"
value="#{WVSForm.a_WVSObject.a_Rayon}"> 
  <f:validateLongRange minimum="0" maximum="9999"/> 
</h:inputText> 

Error: Can't find Component"rayon" 

It works if I set the x:message tag after the input tag: 

<h:inputText id="rayon" styleClass="FieldForm NormalText TextLeftAlign"
value="#{WVSForm.a_WVSObject.a_Rayon}"> 
  <f:validateLongRange minimum="0" maximum="9999"/> 
</h:inputText> 
<x:message for="rayon" detailFormat="*" styleClass="ErrorText" /> 


But on the other hand, in the x:dataTable it doesen't matter. both 

<h:column > 
        <x:message for="skunbr" detailFormat="*" styleClass="ErrorText"
/> 
        <h:inputText id="skunbr" value="#{sku.a_Skunbr}" required="true"
> 
          <f:validateLength minimum="8" maximum="8" /> 
        </h:inputText> 
 </h:column> 

and 

<h:column > 
        <h:inputText id="skunbr" value="#{sku.a_Skunbr}" required="true"
> 
          <f:validateLength minimum="8" maximum="8" /> 
        </h:inputText> 
        <x:message for="skunbr" detailFormat="*" styleClass="ErrorText"
/> 
</h:column> 

work perfectly. 

Now my question is: Is this correct or is this a remaining bug? 

greetz, 

 Chris