-
1. Re: jboss seam @Datamodel
pmuir Nov 3, 2006 4:22 AM (in response to ypasmk)You can use a datatable/ui:repeat etc. on a plain list. You just don't get @DataModelSelection.
-
2. Re: jboss seam @Datamodel
yj4jboss Nov 3, 2006 4:33 AM (in response to ypasmk)Hello Peter,
Is there a way of getting DataModelSelection working with this i.e a DataTable within another DataTable ??
Regards,
Jankee Yogesh
http://www.m-itc.net -
3. Re: jboss seam @Datamodel
pmuir Nov 3, 2006 4:42 AM (in response to ypasmk)AFAIK no. To use @DataModelSelection you must outject a JSF DataModel (@DataModel wraps your List in a DataModel automagically). I suspect you could do it manually but it would take some playing with Seam/JSF.
-
4. Re: jboss seam @Datamodel
bpatters Nov 3, 2006 1:13 PM (in response to ypasmk)I got rid of all my code that used @datamodelselection in favor
of using the parameter seam 1.1 supports.
Now I use:<h:dataTable var="i" value="#{datalist}"> <h:column> <h:commandButton action="#{dataManager.selectItem(i)}" value="select #{i.name}"/> </h:column </h:dataTable>
This works really well, especially if you have nested tables, you can pass
the current table row selection into the function as multiple parameters
using:<h:dataTable var="i" value="#{datalist}"> <h:column> <h:dataTable var="j" value="#{i.subdatalist}"> <h:column> <h:commandButton action="#{dataManager.select SubItem(i,j)}" value="select #{j.name}"/> </h:column </h:dataTable> </h:column </h:dataTable>
Of course this requires you to use Facelets and seam 1.1 with the seam FaceletViewHandler, but it REALLY simplifies things alot. -
5. Re: jboss seam @Datamodel
pmuir Nov 3, 2006 1:32 PM (in response to ypasmk)Nice. You should put that on the wiki as a tip :)
-
6. Re: jboss seam @Datamodel
supernovasoftware.com Nov 3, 2006 1:55 PM (in response to ypasmk)That rocks. Now I will have to switch to seam 1.1 I have been dying to nest tables and it was unclear to me how to do so with datamodel selection. A wiki tip would be most helpful.
-
7. Re: jboss seam @Datamodel
bpatters Nov 3, 2006 2:11 PM (in response to ypasmk)"supernovasoftware.com" wrote:
That rocks. Now I will have to switch to seam 1.1 I have been dying to nest tables and it was unclear to me how to do so with datamodel selection. A wiki tip would be most helpful.
I'll write something up once I get home and have access to my code etc. The above is how I did it last night from memory. I too was having problem figuring out how to @DataModelSelection with nested tables, when I figured I'd just use this technique. The whole selected item being injected from a model thing is hard for me to get my mind around in complex scenarios, but the pass this occurrence of the iteration as a parameter is very easy for me to fit into my way of thinking :) -
8. Re: jboss seam @Datamodel
iradix Nov 3, 2006 5:29 PM (in response to ypasmk)That really is cool. It makes you wonder what the JSF spec leads were thinking to not allow action parameters in the first place.
-
9. Re: jboss seam @Datamodel
gavin.king Nov 3, 2006 5:39 PM (in response to ypasmk)In this case it is the fault of the JSP spec group. (JSTL-EL)
-
10. Re: jboss seam @Datamodel
jjarkko Nov 4, 2006 11:09 AM (in response to ypasmk)I've been using the selectionIs there any additional benefits if you use @DataModel vs. "direct" selection through parameter?
Simply put, is @DataModel deprecated? -
11. Re: jboss seam @Datamodel
jjarkko Nov 4, 2006 11:11 AM (in response to ypasmk)Eh, maybe i meant to ask that is @DataModelSelection deprecated/unneeded.
-
12. Re: jboss seam @Datamodel
gavin.king Nov 4, 2006 2:04 PM (in response to ypasmk)No it is not deprecated.