XPage:对话框在关闭时刷新面板 [英] XPages:dialog box refreshing a panel on close
问题描述
我有一个包含评级自定义控件的文档(xInvolve,非常棒!).在此应用程序中,管理员希望能够删除某个文档或所有文档的某些评级(故意的差评、文档的新版本、对文档所做的更正......).
I have a document that contains a rating custom control (xInvolve, which is excellent!). In this application, administrators want the ability to delete certain ratings for a certain document or all of them (bad ratings on purpose, new version of the document, corrections made to the document ...).
我在一个视图中显示评级,在一个对话框中(扩展库对话框,而不是 Dojo 对话框).在那个对话框中,我有一个全部删除"按钮.该按钮调用一个 SSJS 函数,删除当前打开的文档的评级文档,但我想刷新显示评级的面板,因为它现在应该是空的.
I am showing up the ratings in a view, in a dialog box (the extension Library dialog box, not a Dojo one). In that dialog box, I have a "Delete All" button. That button calls a SSJS function that deletes the rating documents for the document that is currently opened, but I want to refresh the panel that displays the rating, as it should now be empty.
到目前为止,我可以关闭对话框,但似乎无法刷新面板.这是全部删除"按钮的代码:
So far, I was able to close the dialog box, but I can't seem to get the panel to refresh. Here's the code for the "Delete All" button:
<xp:button value="Delete All" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp:confirm
message="Are you sure you want to proceed?">
</xp:confirm>
<xp:executeScript>
<xp:this.script><![CDATA[#{javascript:deleteAllRatings(pageDocument.getDocument().getUniversalID());
var c = getComponent("dialogPageRatings");
c.hide("PanelHeader")}]]></xp:this.script>
</xp:executeScript>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
PanelHeader 是插入 xRating 控件的面板.
The PanelHeader is the panel where the xRating control is inserted.
我应该尝试将代码放入对话框的 onClose 事件中吗?我试过了,但我没有得到更多的运气.
Should I try putting code in the onClose event of the dialog box? I tried but I didn't get more luck.
谢谢
推荐答案
所以你可以使用客户端代码来实现这一点.这就是我们所做的:
So you can use client side code to achieve this. This is what we do:
<xp:executeScript>
<xp:this.script><![CDATA[#{javascript:var strClientCode = "$('#editDeliveryAddressDialog').modal('hide'); window.location.reload();"
view.postScript(strClientCode);}]]></xp:this.script>
</xp:executeScript>
希望有帮助.
这篇关于XPage:对话框在关闭时刷新面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!