[jboss-user] [JBoss Seam] - Unexpected behaviour - DataModel & Nested conversations with
danidacila
do-not-reply at jboss.com
Fri Nov 9 18:16:47 EST 2007
I have a problem which just wont solve. Can this be a bug?
Please help if you can.
Environment - Tomcat 6 + Seam 2 + Richfaces 3.1.2 (or 3.2.0 - the same behaviour)
2 beans:
First
@Scope(CONVERSATION)
@Name("inSectionAction")
which has
@DataModel
private List inDocuments;
Second
@Scope(CONVERSATION)
@Name("inDocumentAction")
which has
@In(required = false)
@Out
private Document inDocument;
@Begin(nested = true)
public void editInDocument(Document inDocument) {
this.inDocument = (Document) contaOnlineDatabase.merge( inDocument);
}
@End
public void cancel() {
}
1st bean used for displaying a table in the page
inSection.xhtml
------------------------------------------------------
<rich:dataTable
value="#{inDocuments}"
var="document">
.... some columns....
one of the column contains
<s:link action="#{inDocumentAction.editInDocument(document)}">
<h:graphicImage value="../img/edit.png"/>
</s:link>
</rich:dataTable>
------------------------------------------------------
the s:link above goes to the edit page which has an edit form and a cancel button in the page
addInDocument.xhtml
------------------------------------------------------
<a4j:commandButton value="Cancel" action="#{inDocumentAction.cancel}"/>
------------------------------------------------------
- you can put any cancel button/link here
the pages.xml is like this:
<page view-id="inSection.xhtml">
<navigation from-action="#{inDocumentAction.editInDocument(document)}">
<redirect view-id="addInDocument.xhtml"/>
<page view-id="addInDocument.xhtml">
<navigation from-action="#{inDocumentAction.save}">
<rule if-outcome="successSaveInDocument">
<redirect view-id="inSection.xhtml"/>
<navigation from-action="#{inDocumentAction.cancel}">
<redirect view-id="inSection.xhtml"/>
So almost exactly like in the Hotel example with one exception - the search (the DataModel) isn't done in a Session bean, but in a Conversation bean.
What happens.
I am in the page with the table,
The table looks nice,
hit the edit button - the edit form looks ok
hit cancel - goes back to the page with the table
now the table contains bad data.
I tried different versions of code and I get 2 results:
1 - the data in the table is completely empty - but the number of rows is ok, like the attributes of the entities in the DataModel are all null
2 - all rows have the same attributes as the one edited, but again the number of rows is ok.
The bad data is only on the screen, not in the database.
Even a refresh of the browser (F5) or enter on the address bar wont change anything.
So it seems that something alters the conversation context... but i can't figure what.
I have tested with rich:datatable.
With h:datatable - not realy the same result but at the second click on edit everything crashes - the parameter to editInDocument comes null
Please heeeelp.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103381#4103381
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103381
More information about the jboss-user
mailing list