-
1. Re: Trinidad table binding
pmuir Aug 13, 2007 4:50 AM (in response to marcopan)I would avoid binding where possible. In this case you can use the selectionListener or selectedRowKeys attributes I think instead.
-
2. Re: Trinidad table binding
marcopan Aug 13, 2007 5:58 AM (in response to marcopan)Thanks for the answer.
I'll avoid the binding, as you suggest, but it is not without a loss of elegance in the code.
If you select many rows and use a listener you do a roundtrip for every selection (to save the keys of the selected rows somewhere) , while you actually need only the last one, when you activate the command (in instance, when you click the "delete" button after having selected the delatable rows).
But the real question is:
Is this problem in the binding of the trinidad table something concerning this specific components or is it something that affects other components and/or the whole seam/trinidad cohabitation? The binding problem would affect even a standard h:dataTable or the rich:dataTable components (even if you do not need to bind a standard datatable as you do not have any information to collect)?
Thanks a lot
Marco -
3. Re: Trinidad table binding
stu2 Aug 13, 2007 11:23 AM (in response to marcopan)I'm curious about this as well. I understand that binding JSF components to logic in Seam component is somewhat impure. But occassionally it's needed.
Pete, do you suggest avoiding binding because it won't work with Seam or because it isn't as elegant? -
4. Re: Trinidad table binding
pmuir Aug 13, 2007 11:29 AM (in response to marcopan)Because it isn't elegant. You can do it (but you must bind to an EVENT scoped component, or SESSION I guess, just not conversational). N.B. You can also inject the JSF component using
@In("#{uiComponent['clientId']}") UIComponent cmp;
which I think is much neater (and doesn't have scope restrictions).
I haven't used this pattern much, so can't offer best practice advice atm.