-
1. Re: DataModel vs a regular list in rich:dataTable
swd847 Oct 12, 2009 1:42 AM (in response to phantasmo)You can still use the parameter if you submit the form (i.e. h:commandLink instead of s:link).
-
2. Re: DataModel vs a regular list in rich:dataTable
asookazian Oct 12, 2009 3:56 AM (in response to phantasmo)The main purpose of the ListDataModel outjection/injection pattern implemented via @DataModel, @DataModelSelection, and @DataModelSelectionIndex is to allow you to have access to the rowId or entity selected when the user submits a form via a button/link in the dataTable (typically there are multiple links/buttons in the table in one column, one per row).
I've never had any problems with it other than when the user sorts a dataTable by clicking a column header (Richfaces), then the row/entity gets screwed up in the backing bean.
IIRC, s:link is for GET requests and h:commandLink is for POST requests. You typically don't use s:link with dataTable form submissions...
-
3. Re: DataModel vs a regular list in rich:dataTable
clerum Oct 12, 2009 5:49 AM (in response to phantasmo)You can also wrap the List right on the page.
value="#{dataModels.getDataModel(summaryBillingAccountNumber.invoices)}" or in your case value="#{dataModels.getDataModel(items)}"
This does break JBoss Tooling suggestions. I opened a JIRA on it JBIDE-4870 but no clue if it's even possible for them to make it work.
I've found this really useful in areas where I'm trying to expose a clickable list on a association deep in my model and not wanting to @DataModel it.
-
4. Re: DataModel vs a regular list in rich:dataTable
phantasmo Oct 12, 2009 12:03 PM (in response to phantasmo)I understand now.
Thank you guys for such detailed answers! You were very helpful!
#{dataModels.getDataModel(items)}Nice trick! I agree that this approach can be very useful in certain cases. Thanks!