Hi Pete,
Thank you so much for your patiently responding my questions. In fact, I have
an idea to use conversation browse bean. User can browsing the search results,
then he/she can either create a new instance or edit an existing instance
through another conversation bean from the browsing page. After he/she
finishes, the user can go back the previous conversation browse bean. However,
I couldn't get it work. The codes are as following. Thank you very much in
advance.
[EMAIL PROTECTED]
| @Name("studyBrowser")
| @Scope(ScopeType.CONVERSATION)
| public class StudyBrowserAction implements StudyBrowser {
| ...
|
| @Begin (id="browing-study")
| public void find() {
| page = 0;
| queryStudy();
| }
|
| @Begin(join=true)
| public void nextPage() {
| page++;
| queryStudy();
| }
|
| @Begin(join=true)
| public void previousPage() {
| page--;
| queryStudy();
| }
|
| private void queryStudy() {
| ...
| }
|
| @Remove
| public void destroy() {}
| }
|
StudyEditorAction.java
| @Stateful
| @Name("studyEditor")
| @Scope(ScopeType.CONVERSATION)
| public class StudyEditorAction implements StudyEditor {
|
| @Begin(id="create-study"
| public String createStudy() {
| ...
| }
|
| @Begin(id="edit#{study.id}")
| public void editStudy() {
| ...
| }
|
| @Begin(join=true)
| public void create() {
| ...
| }
|
| @Begin(join=true)
| public void update() {
| ...
| }
|
| @End
| public void done() {
| ...
| }
|
| @End
| public void cancel() {}
|
| @Remove
| public void destroy() {}
| }
xhtml page:<h:selectInputText id="studyBrowsing" />
| <h:commandButton id="findStudy" value="Browse Study"
action="#{studyBrowser.find}" />
|
| <h:commandLink value="Create New Study"
action="#{studyEditor.createInstance}"/>
|
|
| <h:dataTable id="studies" value="#{studies}" var="study" >
| ...
| <h:column>
| <f:facet name="header">Action</f:facet>
| <ice:commandLink value="Edit Study"
action="#{studyEditor.editStudy}"/>
| </h:column>
| </h:dataTable>
|
| <h:commandLink value="Next Page" action="#{studyBrowser.nextPage}"/>
| <h:commandLink value="Previous Page" action="#{studyBrowser.previousPage}"/>
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103125#4103125
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103125
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user