Struts2和Dojo(双?)发布
我正在发布dojo主题:Struts2和Dojo(双?)发布,struts2,dojo,publishing,publish-subscribe,Struts2,Dojo,Publishing,Publish Subscribe,我正在发布dojo主题: dojo.event.topic.publish("publishThisTarget"); 在JSP中,我有一些listenTopics: <s:url var="url2publish" action="MyAction" namespace="/public" /> <sx:div showLoadingText="false" indicator="ajaxIndicator" id="content" href="%
dojo.event.topic.publish("publishThisTarget");
在JSP中,我有一些listenTopics:
<s:url var="url2publish" action="MyAction" namespace="/public" />
<sx:div showLoadingText="false" indicator="ajaxIndicator"
id="content" href="%{url2publish}" theme="ajax"
listenTopics="publishThisTarget" preload="false"
afterNotifyTopics="/ajaxAfter">
</sx:div>
问题是,我的行动被公布了两次,我不知道为什么 struts也有同样的问题,你必须在触发触发器后断开它,然后由div内容刷新重新配置它 Javascript:
dojo.event.topic.subscribe("/clearMsg", function(date, type, request) {
dojo.event.topic.destroy('publishThisTarget');
});
JSP:
<s:url var="url2publish" action="MyAction" namespace="/public" />
<sx:div showLoadingText="false" indicator="ajaxIndicator"
id="content" href="%{url2publish}" theme="ajax"
listenTopics="publishThisTarget" preload="false"
beforeNotify="/clearMsg" afterNotifyTopics="/ajaxAfter">
</sx:div>