0

I am publishing with dojo topics:

dojo.event.topic.publish("publishThisTarget");

And in JSP I have 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>

The problem is, that my action is published twice and I have no clue why.

erisco
  • 14,154
  • 2
  • 40
  • 45
Trick
  • 3,779
  • 12
  • 49
  • 76

1 Answers1

1

I had the same problem with struts you have to disconnect the trigger after it was fired, and it will be reconfigured by the div content refresh.

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>
Zenithar
  • 240
  • 6
  • 22