voyent
How to programmatically select a dataTable row?  XML
Forum Index -> Components
Author Message
leomena

Joined: 11/Dec/2006 00:00:00
Messages: 39
Offline


Acording to IceFaces 1.6 documentation one can programmatically select a row on a dataTable but I couldn't accomplish this yet.

Any help?
emaranu

Joined: 03/Oct/2016 06:55:10
Messages: 3
Offline


In icefaces 3.3 you can bind the statemap attribute to an object in the backing bean. Then in the backing you can unselect and select the rows.

Backing bean statemap
Code:
private Map<Object, RowState> stateMap;



Unselect all selected rows. This will then update the frontend
Code:
for (Object rowData : stateMap.getSelected()) {
                        RowState s = stateMap.get(rowData);
                        s.setSelected(false);
                  }
 


Select all selectable rows. This will then update the frontend
Code:
for (Object rowData : stateMap.getSelectable()) {
                      RowState s = stateMap.get(rowData);
                      s.setSelected(true);
                 }


To only select one row in the list you can just get one object from the map using a key.
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team