-
1. Re: DataModel outjection and navigation problem
liebner Feb 19, 2006 11:07 AM (in response to liebner)Hi all,
quick addition:
I tried delegating the request handling to a SLSB like in the generated examples (copied a selector and removed some methods). Same result.
My jsf page expects the DataModel to be named "yxz" like mentioned above.
Any ideas?
Greetings,
Stefan -
2. Re: DataModel outjection and navigation problem
gavin.king Feb 19, 2006 11:14 AM (in response to liebner)A DataModel is outjected when either:
* An action method of the component is called
* You have an @Factory method defined
Probably you can fix your problem by adding an @Factory method.
Also check the scope of the @DataModel, esp. if you are using an SLSB. -
3. Re: DataModel outjection and navigation problem
liebner Feb 19, 2006 1:07 PM (in response to liebner)Hi Gavin,
I tried@Factory(value="xyzList") @DataModel(value="xyzList") public List<xyz> getXyzList() { ... }
That raises an exceptionjava.lang.IllegalArgumentException: create method not found ... Caused by: java.lang.NoSuchMethodException: $Proxy414.getXyzList() at java.lang.Class.getMethod(Class.java:1581) at org.jboss.seam.Component.callComponentMethod(Component.java:1116) ... 40 more
I also tried the PAGE scope for the DataModel. No change.
Well, if I understand the outjection invocation algorithm correctly, I have to call Bean B2 from my example and have B1 injected into B2 to get the data from B1.
I'll give it a try.
Thanks so far,
Stefan -
4. Re: DataModel outjection and navigation problem
liebner Feb 19, 2006 1:24 PM (in response to liebner)Hi Gavin,
when I invoke Bean B2 from the JSF Page and pull the state from B1 everything works fine.
The first Page P1 was rendered using data from B1. Than the request adresses B2 which is rendered by P2.
Is it for granted, that I always get B1 in B2?
B1 is the Finder with Session Scope and B2 is Conversation Scope.
OK, works for now, have to shift some code around :-)
Thanks a lot,
Stefan -
5. Re: DataModel outjection and navigation problem
gavin.king Feb 19, 2006 1:43 PM (in response to liebner)"liebner" wrote:
Hi Gavin,
I tried@Factory(value="xyzList") @DataModel(value="xyzList") public List<xyz> getXyzList() { ... }
That raises an exceptionjava.lang.IllegalArgumentException: create method not found ... Caused by: java.lang.NoSuchMethodException: $Proxy414.getXyzList() at java.lang.Class.getMethod(Class.java:1581) at org.jboss.seam.Component.callComponentMethod(Component.java:1116) ... 40 more
Because you forgot to add getXyzList() to the local interface. -
6. Re: DataModel outjection and navigation problem
liebner Feb 21, 2006 11:34 AM (in response to liebner)Hi Gavin,
you're right.
Works fine now.
To clarify your remark with the factory annotation:
-It is enough to have one @Factory annotation per EJB to get all DataModels outjected.
-The Method annotated like that is currently called first. I use that method to refresh an EntityBean for all other DataModels.
Thanks a lot again,
Stefan