[jboss-user] [JBoss Seam] - Re: Why cannot I run more than one concurrent conversation S
gus888
do-not-reply at jboss.com
Fri Nov 2 09:19:51 EDT 2007
"pete.muir at jboss.org" wrote : The programmer would make the navigation link he clicks propagation="none"
Hi Pete,
Thank you very much for your replies on my several Conversation discussion post. Could you please give me a details instruction in the following codes which I modified from the booking example? I changed the HotelSearch bean from Session to Conversation. Thank you so much in advance.
HotelSearch.java at Stateful
| @Name("hotelSearch")
| @Scope(ScopeType.CONVERSATION)
| @Restrict("#{identity.loggedIn}")
| public class HotelSearchingAction implements HotelSearching {
| ...
|
| @Begin
| public void find() {
| page = 0;
| queryHotels();
| }
|
| @Begin(join=true)
| public void nextPage() {
| page++;
| queryHotels();
| }
|
| @Begin(join=true)
| public void previousPage() {
| page--;
| queryHotels();
| }
|
| private void queryHotels() {
| ...
| }
|
| @Remove
| public void destroy() {}
| }
|
HotelBooking.java at Stateful
| @Name("hotelBooking")
| @Scope(ScopeType.CONVERSATION)
| @Restrict("#{identity.loggedIn}")
| public class HotelBookingAction implements HotelBooking {
|
| @Begin
| public void selectHotel(Hotel selectedHotel) {
| ...
| }
|
| public void bookHotel() {
| ...
| }
|
| public void setBookingDetails() {
| ...
| }
|
| @End
| public void confirm() {
| ...
| }
|
| @End
| public void cancel() {}
|
| @Remove
| public void destroy() {}
| }
and main.xhtml<h:selectInputText id="searchString" />
| <h:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" />
|
| <h:dataTable id="hotels" value="#{hotels}" var="hot" >
| ...
| <h:column>
| <f:facet name="header">Action</f:facet>
| <ice:commandLink id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
| </h:column>
| </h:dataTable>
|
| <h:commandLink value="Next Page" action="#{hotelSearch.nextPage}"/>
| <h:commandLink value="Previous Page" action="#{hotelSearch.previousPage}"/>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101295#4101295
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101295
More information about the jboss-user
mailing list