ApplicationLayout 控件 (extlib) 中的 TitleBar 选项卡生成无效代码 [英] TitleBar tabs in ApplicationLayout control (extlib) generating invalid code

查看:16
本文介绍了ApplicationLayout 控件 (extlib) 中的 TitleBar 选项卡生成无效代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ApplicationLayout 控件 (8.5.3 UP1) 并添加了要显示为选项卡的基本节点.我希望选项卡在单击时运行 JavaScript 以设置 sessionScope 变量.我在 onClick 中有一个 sessionScope.put,但在单击选项卡时变量设置不正确.

更糟糕的是,当我查看页面的源代码时,我看到的标签是这样的:

    <li class="lotusTabs li"><div><a style="text-decoration:none">英尺.皮尔斯

<li class="lotusTabs li"><div><a href="javascript:;"onclick="javascript:Ft. Pierce" style="text-decoration:none">Naperville</a>

<li class="lotusTabs li"><div><a href="javascript:;"onclick="javascript:Naperville" style="text-decoration:none">芝加哥</a>

请注意,第一个 li 没有 href 或 onclick 代码,而其他两个 li 条目的 href 和 onclick 参数似乎不正确(并且 onclick 与标签不匹配).

从我在控件中看到的来看,这应该可行.如果节点的 href 属性中没有任何内容,它应该执行 onClick 代码.我很感激任何关于让这个工作的想法或想法.谢谢.

解决方案

basicTreeNode 上的 onClick 事件用于运行客户端 javascript.您将无法放置任何 SSJS,例如您所描述的 sessionScope.put.

要执行您的要求,您需要使用 basicTreeNode 的 submitValue 属性,然后添加脚本以将 sessionScope 设置为 applicationLayout 控件的 onItemClick 事件.

<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>

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 clicked. I have a sessionScope.put in the onClick but the variable is not set properly when the tab is clicked.

Worse, when I look at the source of the page, this is what I see for the tabs:

<ul id="view:_id1:_id2:applicationLayout1_tb" class="lotusTabs lotusTabsIndented">

 <li class="lotusTabs li">
  <div>
   <a style="text-decoration:none">Ft. Pierce</a>
  </div>
 </li>

 <li class="lotusTabs li">
  <div>
   <a href="javascript:;" onclick="javascript:Ft. Pierce" style="text-decoration:none">Naperville</a>
  </div>
 </li>

 <li class="lotusTabs li">
  <div>
   <a href="javascript:;" onclick="javascript:Naperville" style="text-decoration:none">Chicago</a>
  </div>
 </li>
</ul>

Notice how the first li does not have an href or onclick code and the other two li entries have what appears to be incorrect href and onclick parameters (and that the onclick does not match the label).

From what I can see in the control, this should work. It should execute the onClick code if there is nothing in the href property for the node. I'd appreciate any thoughts or ideas on getting this working. Thanks.

解决方案

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>

这篇关于ApplicationLayout 控件 (extlib) 中的 TitleBar 选项卡生成无效代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆