@DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.0.0
newlukai May 30, 2006 10:11 AMHi,
after a one-day-odyssey I'm wondering if anybody encountered this problem before I did. A search in this forum shows, that nobody had problems regarding a tomahawk dataTable with the new JBoss AS and Seam versions.
I updated to
JBoss Eclipse IDE 1.6.0 GA (because it knows what's the JBoss AS library like)
JBoss AS 4.0.4 GA
JBoss Seam 1.0.0 CR3 (BTW: why is it called CR, and not RC anymore?)
Apache myFaces Core 1.1.3
Apache myFaces Tomahawk 1.1.2
the new facelets version included in the booking demo (I think it's 1.0.14)
Some weeks ago I followed the http://wiki.jboss.org/wiki/Wiki.jsp?page=DataModelWithTomahawkDataTable. It worked very well. I could also use it with inheritance (the superclass holds the list, the @DataModelSelection and the @DataModelSelectionIndex; the sub-classes provide different @DataModel and @Factory methods; works fine).
But now, when I deploy, Seam tells me that I'm using multiple @DataModelSelection fields.
Console wrote:
15:43:03,265 ERROR [[/ares]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.IllegalStateException: Multiple @DataModelSelection fields for: testactionsForValidator
at org.jboss.seam.Component.initMembers(Component.java:476)
at org.jboss.seam.Component.<init>(Component.java:185)
at org.jboss.seam.Component.<init>(Component.java:151)
at org.jboss.seam.Component.<init>(Component.java:146)
at org.jboss.seam.Component.<init>(Component.java:141)
at org.jboss.seam.init.Initialization.addComponent(Initialization.java:290)
....
I don't know why. I didn't change the code (OK, I removed all the @Interceptors) and every component only holds one @DataModelSelection field:
public class SearchTestactionAction implements Serializable, SearchTestaction { @PersistenceContext(unitName = "aresDatabase") private EntityManager em; @In(required=false) private Testaction testaction; private List<Testaction> foundTestactions; @DataModelSelection @Out(required=false, scope=ScopeType.SESSION) private Testaction foundTestaction; @DataModelSelectionIndex private int foundTestactionIndex; @In(required=false) private Release selectedRelease; private String sortColumn = "id"; private boolean ascending = true; @Factory("foundTestactions") public String search() { // ... omitted ... // Collections.sort(foundTestactions, new TestactionComparator(sortColumn, ascending)); return "search"; } @DataModel public List<Testaction> getFoundTestactions() { return foundTestactions; } // ... omitted ... // public boolean isAscending() { return ascending; } public void setAscending(boolean ascending) { if (ascending!=this.ascending) { foundTestactions = null; } this.ascending = ascending; } public String getSortColumn() { return sortColumn; } // ... omitted ... // @Remove @Destroy public void destroy() { } }
Would be nice, if someone could post a hint ...
Regards
Newlukai