-
1. Re: @DataModelSelection doesn't work in Restful
dhinojosa Oct 9, 2007 2:40 PM (in response to dhinojosa)Actually, let me look more into this and recreate this issue. hmmm.
-
2. Re: @DataModelSelection doesn't work in Restful
dhinojosa Oct 9, 2007 3:24 PM (in response to dhinojosa)Nevermind, I was just being an idiot. ;)
-
3. Re: @DataModelSelection doesn't work in Restful
igx89 Oct 15, 2007 2:52 PM (in response to dhinojosa)Care to elaborate? :)
I just ran across the same issue: using DataModel without a Factory worked fine, but when I added DataModelSelection into the mix it always was just the first element until I put the Factory annotation on the getter for my DataModel.
If this is expected behavior, then putting a warning about this into the document would undoubtedly save many people from frustration. -
4. Re: @DataModelSelection doesn't work in Restful
igx89 Oct 15, 2007 2:53 PM (in response to dhinojosa)Admin: change "document" to "documentation"
-
5. Re: @DataModelSelection doesn't work in Restful
dhinojosa Oct 15, 2007 6:28 PM (in response to dhinojosa)Sweet! No ever asked to elaborate my idiocy;) Just kidding
What I had done (with simple but not the same example) was I created a bean just to try things out@Stateful @Name("searchEmployeesByState") @Scope(ScopeType.SESSION) public void SearchEmployeesByState ... { private List<Employee> employees; /** * Getters and setters, em finders, etc here */ }
I then produced a page to view just to try things out<h:dataTable value="#{searchEmployeesByState.employees}" var="employee"> .... </h:dataTable>
Note, the value in my data table....Because that's where my problem occured.
I then decided that I wanted to select the model....so like a good citizen I changed my bean...@Stateful @Name("searchEmployeesByState") @Scope(ScopeType.SESSION) public void SearchEmployeesByState ... { @DataModel private List<Employee> employees; @DataModelSelection private Employee employee; /** * Getters and setters, em finders, etc here */ }
Now that I did that, I didn't change my web page like I should've. That's when an angry mind and a keyboard can go a long way to ruin your day. I was trying different combos with factory, etc, and I couldn't figure out why my one item wasn't being selected. Finally, after a while and came back and realized I had to make my web page into the following. Basic seam stuff, but I just missed it. :(<h:dataTable value="#{employees}" var="employee"> .... </h:dataTable>
-
6. Re: @DataModelSelection doesn't work in Restful
igx89 Oct 16, 2007 10:24 AM (in response to dhinojosa)Thanks :).
However, that unfortunately doesn't help with the problem I found; could someone from the Seam team explain the behavior I'm encountering? -
7. Re: @DataModelSelection doesn't work in Restful
pmuir Oct 16, 2007 11:31 AM (in response to dhinojosa)@DataModel & @DataModelSelection aren't restful as they rely on the viewstate being restored. This is why we have page parameters.
-
8. Re: @DataModelSelection doesn't work in Restful
igx89 Oct 16, 2007 11:34 AM (in response to dhinojosa)My problem has nothing to do with "restful"-ness; I'll create a new thread to properly separate things...