-
1. Re: DataModel issue
gavin.king Apr 26, 2006 1:32 PM (in response to kh2ouija)<ui:repeat> is not a UIData, so you can't use the DataModel stuff.
Use request parameters instead. -
2. Re: DataModel issue
kh2ouija Apr 27, 2006 3:38 AM (in response to kh2ouija)That's strange to hear, because I've used it before, instead of a <h:dataTable> and it *does* work...
-
3. Re: DataModel issue
gavin.king Apr 27, 2006 11:42 AM (in response to kh2ouija)OK, Jacob says that <ui:repeat> _is_ aware of DataModels, even though it is not a UIData.
Well, I'm not sure, it should in priniple work. Try debugging.
You are welcome to submit a VERY SIMPLE test case to JIRA. -
4. Re: DataModel issue
kh2ouija May 2, 2006 2:48 AM (in response to kh2ouija)Well, if it's aware of DataModels, my initial question remains valid, how do I handle multiple (variable number of) DataModels? Or do I still have to use request parameters?
-
5. Re: DataModel issue
kh2ouija May 2, 2006 2:57 AM (in response to kh2ouija)My initial question was not if it works.
It was this: the elements of my "main" DataModel have a OneToMany association (eg. Department -* Employee). How do I handle the employees as DataModels too? to have actions for them on the same page.. thanks. -
6. Re: DataModel issue
gavin.king May 2, 2006 12:25 PM (in response to kh2ouija)You can put @DataMode on a method, if you like.
-
7. Re: DataModel issue
kh2ouija May 4, 2006 3:11 AM (in response to kh2ouija)Like, which method? Do you mean annotating the @OneToMany relationship Department.employees with @DataModel in the Department entity bean?
-
8. Re: DataModel issue
gavin.king May 4, 2006 11:42 AM (in response to kh2ouija)Add a getEmployees() method, or something.
-
9. Re: DataModel issue
dbatcn Jul 27, 2006 1:10 PM (in response to kh2ouija)I have a test case at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=86726&postdays=0&postorder=asc&start=10#3961165 . It has one <ui:repeat> nested inside another. The outer one is generated by a @Factory method in a stateful session bean and the inner one by a method in an entity bean. The two kinds of entity beans are related by @ManyToMany. If nobody sees a problem with it then I'll submit it to JIRA.
-
10. Re: DataModel issue
gavin.king Jul 27, 2006 1:34 PM (in response to kh2ouija)Unless you are sure there is a bug in Seam, and you know the nature of the bug, you should not create any JIRA issues. Nothing in this thread indicates you have found any kind of bug.
-
11. Re: DataModel issue
dbatcn Jul 27, 2006 1:57 PM (in response to kh2ouija)In the other topic I wrote:
When pressing the "rename" buttons, the value that I expect to be injected is not there (the log.error() calls below are triggered).
for instance (and yes, sorry for not including it in the previous post):2006-07-27 10:51:56,946 DEBUG [org.jboss.seam.Component] selected row: null
2006-07-27 10:51:56,946 DEBUG [org.jboss.seam.Component] instantiating Seam component: interpolator
2006-07-27 10:51:56,946 ERROR [com.orgmob.play.FubarManagerBean] FubarManagerBean.commitFoo() called but foo is null!
...
2006-07-27 10:52:00,431 DEBUG [org.jboss.seam.Component] selected row: null
2006-07-27 10:52:00,431 DEBUG [org.jboss.seam.Component] instantiating Seam component: interpolator
2006-07-27 10:52:00,431 ERROR [com.orgmob.play.FubarManagerBean] FubarManagerBean.commitBar() called but bar is null!
When I press buttons that were generated using <ui:repeat> from a @DataModel, org.jboss.seam.Component says that no row was selected and where I expected @DataModelSelection to inject a value, the value is null. I think that is a bug. Am I in error? -
12. Re: DataModel issue
gavin.king Jul 27, 2006 2:18 PM (in response to kh2ouija)I don't know the details of what works in facelets and what doesn't. You should ask about that in the facelets forum. But if it works when using h:dataTable, but not when using ui:repeat then it is definitely not a bug in Seam.
-
13. Re: DataModel issue
cptnkirk Jul 27, 2006 3:33 PM (in response to kh2ouija)I think the original post is conceptually wrong. <ui:repeat> is an iterator. It can iterate over lists of things, including DataModels. However it doesn't modify the model that is iterates over. For example it will never set a DataModel's selected row and using @DataModelSelection with it will never work.
<ui:repeat> is a powerful substitue to using c:forEach. It is not a direct replacement for h:dataTable.
Maybe I misunderstand the original question. If you need @DataModelSelection to work, you'll need to go back to h:dataTable. -
14. Re: DataModel issue
gavin.king Jul 27, 2006 3:38 PM (in response to kh2ouija)Note that there are plenty of other ways to implement clickable lists apart from @DataModelSelection. Arguably, using a request parameter (like in the blog example) is simply a better approach to begin with.