-
1. Re: The solution for GET requests
hookomjj Nov 9, 2005 6:58 PM (in response to gavin.king)if find() is dependent on other inputs, then the expectation is that the component is fully populated based on the current Contextual state before invoking find() ?
-
2. Re: The solution for GET requests
gavin.king Nov 9, 2005 7:31 PM (in response to gavin.king)Sure. the @Factory method functions pretty much just like an event listener method.
-
3. Re: The solution for GET requests
christian.bauer Nov 9, 2005 7:46 PM (in response to gavin.king)Stupid question:
"So, when faces tries to resolve the variable, and it is empty, the factory method of the component will be invoked "
Which component? -
4. Re: The solution for GET requests
christian.bauer Nov 9, 2005 9:09 PM (in response to gavin.king)This feature doesn't seem to work for non-datamodel factory variables:
@Out(scope = EVENT, required = false)
public TreeNode categoryTree;
@Out(scope = EVENT, required = false)
public TreeNode node;
@Factory("categoryTree")
public void initializeTree() { ... }
Caused by: java.lang.NoSuchMethodException: org.hibernate.ce.auction.seam.noejb.BrowseCategories$$EnhancerByCGLIB$$d5838cdf.initializeTree()
at java.lang.Class.getMethod(Class.java:1581)
at org.jboss.seam.Component.callComponentMethod(Component.java:926)
at org.jboss.seam.Component.getInstanceFromFactory(Component.java:887)
at org.jboss.seam.Component.getInstance(Component.java:850)
at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:43)
Maybe it shouldn't use instance.getClass().getMethod() to resolve the factory method, but somehow consider the proxy. -
5. Re: The solution for GET requests
gavin.king Nov 9, 2005 10:23 PM (in response to gavin.king)Presumably some kind of problem with JavaBean components, though I don't quite understand it. Should work using instance.getClass().getMethod().
-
6. Re: The solution for GET requests
renspr Nov 10, 2005 12:29 PM (in response to gavin.king)@Factory works for me on non-datamodel factory variables:
@PersistenceContext private EntityManager em; @Out private List<Post> posts; @Factory("posts") public void find() { posts = em.createQuery("from Post").getResultList(); log.info(posts.size() + " posts found"); }
@Factory("categoryTree") public void initializeTree() { ... } Caused by: java.lang.NoSuchMethodException: org.hibernate.ce.auction.seam.noejb.BrowseCategories$$EnhancerByCGLIB$$d5838cdf.initializeTree() at java.lang.Class.getMethod(Class.java:1581) at org.jboss.seam.Component.callComponentMethod(Component.java:926) at org.jboss.seam.Component.getInstanceFromFactory(Component.java:887) at org.jboss.seam.Component.getInstance(Component.java:850) at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:43)
I think you have to specify initializeTree() in the local interface of your session bean. -
7. Re: The solution for GET requests
christian.bauer Nov 10, 2005 5:44 PM (in response to gavin.king)The problem seems to be with JavaBean components, not EJB components. There is an open JIRA issue.