aspose file tools*
The moose likes JSF and the fly likes RF(3.3.3) ajaxKeys in custom ExtendedDataTableModel, column reRender problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "RF(3.3.3) ajaxKeys in custom ExtendedDataTableModel, column reRender problem" Watch "RF(3.3.3) ajaxKeys in custom ExtendedDataTableModel, column reRender problem" New topic
Author

RF(3.3.3) ajaxKeys in custom ExtendedDataTableModel, column reRender problem

Eduard Mamedov
Greenhorn

Joined: May 20, 2010
Posts: 23
Hello, all!
I have a problem. I need to reRender selected row when user clicks button, but my ExtendedDataTableModel are custom and have method getRowKey() that return Strings, not Integers. I read that ajaxKeys needs set of Integers (not strings)
I already tried use ajaxKeys without custom table model, and it works fine! When row selected I receive ordinal number, set it to collection and returns it to ajaxKeys. All works perfect!!!
But now in my custom ExtendedDataTableModel (used in my project) "rowKeyVar" returns strings that represents some internal state. So I don't know now how to reRender selected rows in extended table.

Correct me If I not right?...ajaxKeys needs ordinal numbers of rows?? I also try to return set of (1,2, 3) bit nothing happens ....

How ajaxKeys maps?? I don't found how it works.


SCJP 6
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

I would have to have a closer look at the code than I can afford to do, plus review the RichFaces docs, but I can tell you this. A dataTable - be it basic JSF or RichFaces extendedDataTable - is backed by a DataModel object that wraps the row data. Any row in that object is accessible via its index in the list or array that the DataModel backs. When working on a specific row, the model's getRowData() method can return a reference to the row data, and if memory serves, the corresponding method to get its index is "getRowIndex". Since that's a proper name for a property method, the corresponding EL expression would be "xxxbean.xxxmodel.rowIndex", where "xxxmodel" is the property name of that particular DataModel.

If you did not explicitly define a DataModel property, an anonymous one will be created, but since it's anonymous, you will find it very difficult to access the model-specific properties. Which is why I recommend always explicitly creating a DataModel except for the rare cases where you simply want to display a table and don't care about references to its individual rows.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RF(3.3.3) ajaxKeys in custom ExtendedDataTableModel, column reRender problem
 
Similar Threads
TableCellRenderer Problem
making a selected cell editable in JTable and removing a selected row from JTable
problems moving cursor in resultset
JTable with different objects (or components) in a column
using OGNL