Monday, December 06, 2010

Expand and Collapse views in xPages

Found very nice solution

Collapse all
 var viewPanel = getComponent(compositeData.viewPanelName);  
 var model:com.ibm.xsp.model.domino.DominoViewDataModel = viewPanel.getDataModel();  
 var container:com.ibm.xsp.model.domino.DominoViewDataContainer = model.getDominoViewDataContainer();  
 container.collapseAll();  

Expand all
 var viewPanel = getComponent(compositeData.viewPanelName);  
 var model:com.ibm.xsp.model.domino.DominoViewDataModel = viewPanel.getDataModel();  
 var container:com.ibm.xsp.model.domino.DominoViewDataContainer = model.getDominoViewDataContainer();  
 container.expandAll();  

That's much better then save values in sessionScope/RequestScope and use property expandLevel in viewPanel.

No comments :