Hello Rodrigo,

You mean like being in one room in a browser tab and in another room in
another? If so I suggest that you use Trinidad and use a pageFlowScoped bean
instead of a session bean and store the selected roomId there. Otherwise
you'll have to deal with tokens (push the current roomId in a hidden field
for example).


Regards,

~ Simon

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

 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]> 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