I am using an ApplicationLayout control (8.5.3 UP1) and have added Basic Nodes to be displayed as tabs. I want the tabs to run JavaScript to set a sessionScope variable when cl
The onClick event on a basicTreeNode is used for running clientSide javascript. You won't be able to put any SSJS such as the sessionScope.put that you have described.
To do what you require you will need to use the submitValue property of the basicTreeNode and then add your script to set the sessionScope to the onItemClick event of the applicationLayout control.
<xe:applicationLayout id="applicationLayout1">
<xe:this.configuration>
<xe:oneuiApplication>
<xe:this.titleBarTabs>
<xe:basicLeafNode label="Tab 1" submitValue="tab1" />
<xe:basicLeafNode label="Tab 2" submitValue="tab2" />
<xe:basicLeafNode label="Tab 3" submitValue="tab3" />
</xe:this.titleBarTabs>
</xe:oneuiApplication>
</xe:this.configuration>
<xp:eventHandler event="onItemClick" submit="true" refreshMode="complete">
<xe:this.action><![CDATA[#{javascript:sessionScope.put("varName",context.getSubmittedValue())}]]></xe:this.action>
</xp:eventHandler>
</xe:applicationLayout>