Thanks a lot Mike, Your example is exactly what I was needing.
May I ask you four questions? 2)I gess it is in this way but, are boths page and dataModel are managed beans delcared in a faces-config.xml file? 3)Is there any way of get the reference to UIcomponent (or the value of <optionalRelatedComponentReference>.getClientId(facesContext) ) without using a "binding to page-bean objects" way? 4) Does this returns the id of the UIcomponent tag :<optionalRelatedComponentReference>.getClientId(facesContext) ?? Thanks now and in advance too. Michael --- Mike Kienenberger <[EMAIL PROTECTED]> wrote: > Yes, use the first parameter to associate messages > with a specific UI element. > > See this link for details: > > http://wiki.apache.org/myfaces/Create_and_Display_Messages > > Bottom half includes an example. > > -Mike > > On 9/12/05, Michael Jenik <[EMAIL PROTECTED]> > wrote: > > > > > > --- Michael Jenik <[EMAIL PROTECTED]> wrote: > > > > > Date: Mon, 12 Sep 2005 12:39:58 -0700 (PDT) > > > From: Michael Jenik <[EMAIL PROTECTED]> > > > Subject: duplicated messages useing addMessage > and > > > aliasBean > > > To: [email protected] > > > > > > hello, > > > > > > I have a problem. > > > > > > I have a bean "SmallBean" which performs this: > > > > > > FacesContext context = > > > FacesContext.getCurrentInstance(); > > > > > > context.addMessage(null,MessageFactory.getMessage(context,"myMessageID")); > > > > > > > > > > > > The bean is used into a Tagfile called in this > way. > > > > > > <TABLE> > > > <TR><TD> > > > <x:aliasBean id="alias1" alias="#{laBean}" > > > value="#{BigBean.desde}"> > > > <f:subview id="sub1"> > > > <mistags:untag/> > > > </f:subview> > > > </x:aliasBean> > > > </TD><TD> > > > <x:aliasBean id="alias2" alias="#{laBean}" > > > value="#{BigBean.hasta}"> > > > <f:subview id="sub2"> > > > <mistags:untag/> > > > </f:subview> > > > </x:aliasBean> > > > </TD></TR> > > > </TABLE> > > > > > > > > > Note that BigBean has two properties : desde and > > > hasta > > > of type SmallBean. > > > And the file untag.tag has a <h:messages > > > id="menssageLabel" style="color: red"/> tag in > > > somewhere. > > > > > > > > > The problem Is that the messages generated by > both > > > SmallBean are rendered together and duplicated > in > > > the > > > "desde" rendered part and in the "hasta" > rendered > > > part. > > > > > > > > > Is the first parameter of addMessage useful to > aboid > > > this behaviour ? How can I workarround this > problem? > > > > > > Thanks in Advance. > > > > > > Michael > > > > > > > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > > > protection around > > > http://mail.yahoo.com > > > > > > > > > > > > > __________________________________ > > Yahoo! Mail - PC Magazine Editors' Choice 2005 > > http://mail.yahoo.com > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
