aspose file tools*
The moose likes JSF and the fly likes rich:extendedDataTable user action after each row processing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "rich:extendedDataTable user action after each row processing" Watch "rich:extendedDataTable user action after each row processing" New topic
Author

rich:extendedDataTable user action after each row processing

Sergii Olishchuk
Greenhorn

Joined: Jun 19, 2011
Posts: 7
Hello,

Does anybody know, whether it possible to execute my action after each row is processed in extendedDataTable. I need something like this:



Thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

I don't follow you. Apparently you're mistaking a 2-dimensional tabular display for executable code. All a dataTable (extended or not) does, is render the data based on its underlying model. It does not necessarily execute a loop to do so and even when it does, it's an internal "black-box" process that you can't tie into.

If you want the rows of the table to reflect some sort of specific information, you have to adjust the table's dataModel accordingly.


Customer surveys are for companies who didn't pay proper attention to begin with.
Sergii Olishchuk
Greenhorn

Joined: Jun 19, 2011
Posts: 7
Tim, thank you very much for reply

Actually, my data is based on underlying model, but there is also additional information which should be computed dynamically for each "log" var (this is necessary for heterogenous entities). I got it worked handling List.get method, but this is not what I expected to get, is there any more suitable solution?

Thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

One of the top 10 errors that people make when working with JSF is in thinking that a table dataModel must be an actual basic object such as an ORM Domain Model.

If the data doesn't fit your needs, just make a façade that does. Define a row class that either extends or aggregates the lower-level row-level object and make a collection of those façade row objects to be the wrapped data for the dataModel.
Sergii Olishchuk
Greenhorn

Joined: Jun 19, 2011
Posts: 7
Tim, I agree with you, but i my case source code and jsf pages are autogenerated, and it is difficult to extend system to add this facade. I found workaround using List.get overridden method, it works for me,
Thank you very much for your help
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

One of the problems with these "A monkey can do it in 10 minutes" code generators is that almost every project sooner or later ends up with something that the generator can't handle, and the cost of working around the generator's limits can really bite into the benefits.

Technically, you are using a façade, but it's hard-wired into your custom list element accessor. Not ideologically pure, perhaps, but like I said, working around a limited framework generally requires ugly solutions.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: rich:extendedDataTable user action after each row processing