Hello Simon, 

 

But the real user case is that a chatter can join multiple rooms within the
same session, I mean the chatter could be talking in two or more differents
rooms at the same time. So injecting the Map in the session scope sounds
better, but I don't now how to select just one of the chat rooms.

 

Thanks again.

 

 

  _____  

From: Simon Lessard [mailto:[EMAIL PROTECTED] 
Sent: martes, 10 de julio de 2007 16:48
To: MyFaces Discussion; [EMAIL PROTECTED]
Subject: Re: Managing multiple instance of a managed bean

 

Hello Rodrigo,

Yes this is possible by using an application scoped bean that implements
Map. In your exemple it would be Map<RoomId, Room>. You can then get the
good Room object in your page using the following EL structure: 

#{myAppBean[mySessionBean.roomId].whateverRoomObjectProperty}


Regards,

~ Simon

On 7/10/07, Rodrigo Olmo < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
wrote:

Hi all, 

 

How can i manage multiple instante of a managed bean bind to a jsf? I mean,
suppose you want to create a chat application in which you can create
differents rooms on air. How can I develope the mange bean for each
chatroom? Is it possible to reference managed beans dynamically so I could
create for example room1Bean, room2Bean and bind them dynamically in my JSF?

 

Thanks in advance,

 

Rodrigo

 

Reply via email to