You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adib Saikali <as...@intelligenceaids.com> on 2004/12/24 14:53:18 UTC

Forward references to components

When I forward reference a component in an message tag I get an
exception is this a bug in myfaces 1.0.7?

<h:message id="errors" for="helloInput" style="color: red"></h:message>
<h:inputText id="helloInput" value="#{helloBean.numControls}"
required="true" />

However if I do all is well?

<h:inputText id="helloInput" value="#{helloBean.numControls}"
required="true" />
<h:message id="errors" for="helloInput" style="color: red"></h:message>

Thanks
Adib 





RE: Forward references to components

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Hi Adib,
this is by JSP/JSF combination.

<h:message for="x" .../>
<h:input id="x"/>

calling first time the page, <h:message doesn't know
a component with id x;

workarounds:
-move <h;message/> behind <h:input/> (like you did)
-nest them inside of <h:panelGrid/>

see more on Hans Bergsten's article
http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html

Btw. Hans is JSF-EG-Member, or he was in JSF1.0

HTH,
Matthias

> -----Original Message-----
> From: Adib Saikali [mailto:asaikali@intelligenceaids.com] 
> Sent: Friday, December 24, 2004 2:53 PM
> To: myfaces-user@incubator.apache.org
> Subject: Forward references to components
> 
> 
> When I forward reference a component in an message tag I get 
> an exception is this a bug in myfaces 1.0.7?
> 
> <h:message id="errors" for="helloInput" style="color: 
> red"></h:message> <h:inputText id="helloInput" 
> value="#{helloBean.numControls}" required="true" />
> 
> However if I do all is well?
> 
> <h:inputText id="helloInput" value="#{helloBean.numControls}" 
> required="true" /> <h:message id="errors" for="helloInput" 
> style="color: red"></h:message>
> 
> Thanks
> Adib 
> 
> 
> 
>