我想通過點擊一個按鈕來「激活」其他兩個按鈕的點擊。 我已經把這個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源,然後我可以更正源。 –
編輯的第一篇文章代碼 –