6

The Workspace List

The workspace list allows the user to switch between multiple conversations from the same browser tab. There is no Java code to write, just the following JSF code to include:

<h:dataTable value="#{conversationList}" var="entry"> <h:column> <h:commandLink action="#{entry.select}" value="#{entry.description}"/>   <h:outputText value="[current]" rendered="#{entry.current}"/> </h:column> <h:column> <h:outputText value="#{entry.startDatetime}"> <f:convertDateTime type="time" pattern="hh:mm"/> </h:outputText> - <h:outputText value="#{entry.lastDatetime}"> <f:convertDateTime type="time" pattern="hh:mm"/> </h:outputText> </h:column> </h:dataTable>

We do need to specify what text will be displayed by #{entry.description}. We do this by creating a pages.xml file in our WEB-INF directory.

<pages> <page view-id="/hotel.xhtml">View hotel: #{hotel.name}</page> <page view-id="/book.xhtml">Book hotel: #{hotel.name}</page> <page view-id="/confirm.xhtml">Confirm: #{booking.description}</page> </pages>

Note that you don't need the pages.xml file if you don't want the workspace list in your application.