I am working on a simple messenger using JSF and PrimeFaces. I would like to have contact list in the right part of the window and multiple conversation dialogs in the second part. Dialog will contain just a send button, an input and conversation content.
Use case:
User #1 clicks on contact, chat dialog appears. User #2 is logging to system. System checks that he has 1 unread message so it opens chat dialog. User #2 clicks on another contact and second chat dialog appears.
Questions:
- How to pass some context to dialog like user-you-are-writing-to's ID so when you click on send button in this particular dialog you will be able to access it?
- Is it possible to create a PrimeFaces dialog dynamically from JavaScript> Or maybe there is better solution to do it?