我想让Panel"可点击"并运行SSJS代码.以前当我这样做时,我已经在面板中添加了一个1-cell 1-row表,因为它有一个onClick事件.有没有办法在Panel上做到这一点?
另外 - 如果有一种方法可以在面板上放置onClick,如果该面板包含一个链接,我认为链接将在面板本身"上方"并且可以独立点击....对吗?
只需向面板添加onClick事件即可.以下是单击面板时重定向到"anotherpage"的示例代码:
<xp:panel id="test">
Click me
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:context.redirectToPage("anotherpage.xsp")}]]></xp:this.action>
</xp:eventHandler>
</xp:panel>
Run Code Online (Sandbox Code Playgroud)
如果您向面板添加链接,则链接位于面板"上方":
<xp:panel id="test">
Click me!
<xp:link escape="true" text="and me!" id="link1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:context.redirectToPage("page.xsp")}]]></xp:this.action>
</xp:eventHandler>
</xp:link>
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:context.redirectToPage("window.xsp")}]]></xp:this.action>
</xp:eventHandler>
</xp:panel>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1386 次 |
| 最近记录: |