我想通过点击一个按钮来“激活”其他两个按钮的点击。 我已经把这个ccjs在onclick事件:通过点击一个按钮调用另外两个按钮
document.getElementById("#{id:button28}").click();document.getElementById("#{id:button29}").click();
但后来唯一的按钮28被点击! 然后,我试着将这部分代码放在onclick事件和part2下的onmousedown事件之下。然后,我必须在他实际完成这项工作之前点击此按钮2次。
至今代码:
<xp:button value="Save" id="button26">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script>
<xp:executeClientScript>
<xp:this.script><![CDATA[document.getElementById("#{id:button29}").click();
></xp:this.script>
</xp:executeClientScript>
</xp:this.script></xp:eventHandler></xp:button><xp:button id="button29" value="button29">
<xp:eventHandler
event="onclick" submit="true" refreshMode="partial"
id="eventHandler21" refreshId="outsidePanel5">
<xp:this.action>
<xp:actionGroup>
<xp:executeScript>
<xp:this.script><![CDATA[#{javascript:sessionScope.put("test","");// and some more code}]]>
</xp:this.script>
</xp:executeScript>
</xp:actionGroup>
</xp:this.action>
<xp:this.onComplete><![CDATA[document.getElementById("#{id:button28}").click();]]></xp:this.onComplete>
</xp:eventHandler></xp:button><xp:button value="button28" id="button28">
<xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="outsideMogelijkheid">
<xp:this.action>
<xp:executeScript
script="#{javascript://some code}">
</xp:executeScript>
</xp:this.action>
</xp:eventHandler></xp:button>
我不认为我明白该怎么做。我尝试了以下操作:在第一个按钮的oncomplete事件中,我放了document.getElementById(“#{id:button28}”)。click();所以在sourcepanel中我得到:<![CDATA [document.getElementById(“#{id:button28}”)。click();]]> xp:this.onComplete>一个错误,他无法找到点击属性的值。 –
你可以发布你的问题的xpage源,然后我可以更正源。 –
编辑的第一篇文章代码 –