TitleBar tabs in ApplicationLayout control (extlib) generating invalid code

前端 未结 1 1620
谎友^
谎友^ 2021-01-24 12:26

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

相关标签:
1条回答
  • 2021-01-24 12:51

    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>
    
    0 讨论(0)
提交回复
热议问题