Expand Specific View in XPages

XPages - How to expand a specific category in the view as default

Control Expand/Collapse of the category view

To control Expand/Collapse status of the view in XPages, you just have to use [ExpandLevel] in view data source.
For example, Set "0" to expand, "1" to collapse as default.

Then Is it possible if you want to collapse the view as default except the specific category like below?

Expand Specific View in XPages
Expand Specific View in XPages

Expand only the specific category as default by SSJS

Use the following Serverside Javascript code in afterPageLoad event to expand the specific category.


In the above case, the last line(L4) specifies the first category to expand.

Like this sample code, you can control more if you use SSJS. In this case, I use DominoViewDataModel object. If you are interested in this object, you can see more detail from this link.

You might be able to get more ideas to control view data source directly.