What I think you need to check is that the referenced
component id has the correct "id" path. So it may be
that your component is in a containing jsf component
like a subview which you have given an id so your path
would require the subview id as well.

e.g. containing subview id="svId"
       component id="myComponent"

so the addMessage would require:
FacesContext.getCurrentInstance().addMessage("svId:
myComponent", new FacesMessage(severity, rawMsg,
null));

i.e. requiring the full "id path" including containing
id's. To get your full id path to the component view
your html rendered source and look at the component.

Hope this helps,

Paul

P.S. this explanation is a bit muddled, just started
with jsf.

--- Travis Reeder <[EMAIL PROTECTED]> wrote:

> Are you serious?  Does this mean I have to bind any
> component I want to add
> messages to so that I can actually have a reference
> to the component?
> 
> Travis
> 
> On 12/12/05, Mike Kienenberger <[EMAIL PROTECTED]>
> wrote:
> >
> > addMessage takes a component clientId, not an id.
> >
> > Make sure you're using
> addMessage(component.getClientId(facesContext)...
> >
> > On 12/12/05, Travis Reeder <[EMAIL PROTECTED]>
> wrote:
> > > I'm trying to set a message to show up with the
> h:message tag, but it's
> > not
> > > working.
> > >
> > > Ex: component id="myComponent"
> > >
> > > <h:message for="myComponent"/>
> > >
> > > It shows up validation errors and what not, but
> now when I add like this
> > in
> > > an action method:
> > >
>
FacesContext.getCurrentInstance().addMessage(componentId,
> new
> > > FacesMessage(severity, rawMsg, null));
> > >
> > > I've verified that there is no redirect in
> faces-config happening
> > either.
> > >
> > > Is this a bug?
> > >
> > > Travis
> > >
> > >
> > >
> >
> 



        
        
                
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com

Reply via email to