POI 4 XPages中 - 文档生成仅一次 [英] POI 4 XPages - document generation works only once
问题描述
好吧,说实话:标题并不能说明全部真相。我使用的几个按钮(保存,关闭,编辑等)和执行POI操作的按钮自定义的控制 - 这是一个生成的Word文件。
我在这里遇到一个问题:击中POI按钮后,我的其他按钮(和POI之一,也是)将不再起作用,没有点击触发。
现在的怪之一:等待几秒钟后(取决于我使用的浏览器,Chrome是最快的)我能够点击按钮(全部)再次让我可以如离开(关闭)或编辑我的XPage。
Ok, to be honest: the headline doesn't tell the whole truth. I am using a custom control with several buttons (save, close, edit etc.) and a button that executes a POI action - it's generates a Word file. I experience a problem here: after hitting the POI-button my other buttons (and the POI one as well) won't work anymore, no click is triggered. Now the strange one: after waiting a few seconds (depending on which browser I use, Chrome is fastest) I am able to click the buttons (all of them) again so that I can e.g. leave (close) or edit my Xpage.
我不知道是否有帮助,但这里是我的兴趣点按钮的情况下,code:
I don't know if that helps but here is the event code of my POI button:
<xp:button id="button5" styleClass="btn btn-sm printbutton"
style="display:none">
<i class="fa fa-print"></i>
 
<xp:text>
<xp:this.value><![CDATA[#{javascript:"Nach MS Word exportieren"}]]></xp:this.value>
</xp:text>
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp_1:generateDocument documentId="wordprint"
loaded="true">
</xp_1:generateDocument>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
任何想法如何避免这种行为,或者是一个错误的POI 4 XPages中?
Any ideas how to avoid this behavior or is it a bug in POI 4 XPages?
BTW:我不能让Word文档,例如后立即执行其它的动作执行一个脚本或打开一个网页。这将是也打印后,关闭的XPages一种可接受的方式。
BTW: I am not able to execute another action right after getting the Word document, e.g. execute a script or open a page. That would be also an acceptable way to close the xpages after "printing".
在此先感谢!
推荐答案
奥利弗,添加客户端JS调用 XSP.allowSubmit()
来您的按钮,以允许$ p $后新提交pssing按钮:
Oliver, add the client-side JS call XSP.allowSubmit()
to your button in order to allow new submits after pressing the button:
<xp:button id="button5" styleClass="btn btn-sm printbutton" style="display:none">
<i class="fa fa-print"></i>
 
<xp:text>
<xp:this.value><![CDATA[#{javascript:"Nach MS Word exportieren"}]]></xp:this.value>
</xp:text>
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp_1:generateDocument documentId="wordprint"
loaded="true">
</xp_1:generateDocument>
</xp:actionGroup>
</xp:this.action>
<xp:this.script><![CDATA[XSP.allowSubmit()]]></xp:this.script>
</xp:eventHandler>
</xp:button>
这篇关于POI 4 XPages中 - 文档生成仅一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!