Das könnte die Lösung sein:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:button id="button1" value="Collapse All"><xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp:setValue binding="#{requestScope.collapseAll}">
<xp:this.value><![CDATA[#{javascript:"1"}]]></xp:this.value>
</xp:setValue>
<xp:executeScript
script="#{javascript:context.reloadPage()}">
</xp:executeScript>
</xp:actionGroup>
</xp:this.action></xp:eventHandler></xp:button>
<xp:button value="Expand All" id="button2"><xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
Lösung:
The code in my Expand-Button is:
sessionScope.viewMode = 0;
context.reloadPage()
The collapse button:
sessionScope.viewMode = 1;
context.reloadPage()
In my view-control the property data\data\ExpandLevel is set to:
return parseInt(sessionScope.viewMode);
:)