thanks Rashmi,

But the problem is not so basic like that.
MessageFactory.getMessage(context,"myMessageID")
gets a FacesMessage from a bundle. It's just that.
The duplicated behaviour is the same if I use "new
FacesMessage".

The problema seams to be that when each bean ask for
the FacesContext to addMessages, thay get the same
faces context each other.
Like each bean is related with a tagfile which
renderes a table, the messages of boths beans apears
duplicated inside each of those tables.


....

I think it's an aliasBean problem related.

Can anybody help me with this?
I just used aliasBean to pack repeated code units in
tagfiles. I could try portlets, but I still havn't
learned how to use them. Do they work fine for this?

Regards

Michael






--- Rashmi Kumari <[EMAIL PROTECTED]> wrote:

> 
> Hi,
> 
> Instead of     
> MessageFactory.getMessage(context,"myMessageID")
> 
> you can use  new FacesMessage("Message to print",
> "")
> 
> Thanx and Regards
> 
> Rashmi
> 
> 
> 
> 
>                                                     
>                                                     
>                        
>                     Michael Jenik                   
>                                                     
>                        
>                     <[EMAIL PROTECTED]       To:    
> users@myfaces.apache.org                            
>                            
>                     ahoo.com>            cc:        
>                                                     
>                        
>                                          Subject:   
>  duplicated messages useing addMessage and aliasBean
>                        
>                     09/13/2005                      
>                                                     
>                        
>                     01:09 AM                        
>                                                     
>                        
>                     Please respond                  
>                                                     
>                        
>                     to "MyFaces                     
>                                                     
>                        
>                     Discussion"                     
>                                                     
>                        
>                                                     
>                                                     
>                        
> 
> 
> 
> 
> 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
> 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to