[
http://jira.jboss.com/jira/browse/JBSEAM-1814?page=comments#action_12387054 ]
Daniel Dacila commented on JBSEAM-1814:
---------------------------------------
Simple test case.
I spent 2 nights working on trying different changes thinking that my code is not good.
And I tested it with Ricfaces 3.1.2 and 3.2.0 and simple h:datatable, so it is not faces
related.
I have changed the original hotelBooking example like this:
@Name("hotelSearch")
@Scope(ScopeType.CONVERSATION)
public class HotelSearchingAction implements Serializable {
...
@Begin(join = true)
public void find() {
...
}
...
}
and
@Name("hotelBooking")
public class HotelBookingAction
{
...
@Begin(nested = true)
public void selectHotel(Hotel selectedHotel)
{
...
}
...
}
exactly the same.
1st search - everything ok
hit view hotel - ok
hit cancel - the search view presents all the hotels but their attributes are empty.
DataModel wrapped data is set to null by
ManagedEntityIdentityInterceptor
-------------------------------------------------------------------------
Key: JBSEAM-1814
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1814
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 2.0.0.BETA1
Environment: seam cvs (20070816.1709)
Reporter: Matt Drees
Priority: Minor
Fix For: 2.0.x
The following test fails:
@Name("dataModelComponent")
@Scope(ScopeType.CONVERSATION)
public class DataModelComponent extends EntityQuery {
@Override
public String getEjbql() {
return "from java.lang.Object o";
}
}
public class DataModelComponentTest extends SeamTest {
@Test
public void test() throws Exception {
new FacesRequest() {
@Override
protected void renderResponse() throws Exception {
DataModel model = (DataModel)
getValue("#{dataModelComponent.dataModel}");
assert model.getWrappedData() != null;
}
}.run();
}
}
Because the component is conversation-scoped, a ManagedEntityIdentityInterceptor is
attached, which nulls the wrapped List after getDataModel() is called.
In the referenced forum, Gavin indicated he hadn't decided whether this should be
expected behavior or not, and asked for a jira issue.
If it is expected behavior (I hope not), I think either EntityQuery should not have a
getDataModel() attribute, or it should be documented and/or programmatically enforced that
EntityQuerys should not be conversation-scoped.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira