Hello again,

I am going to answer my own question, although I don't quite understand it.

Looking yet again at the docs:
http://struts.apache.org/2.0.11/docs/ajax-tags.html

I noticed that topic names always started with a slash. So I changed
my topic name from "updateOperatorsListing" to
"/updateOperatorsListing" and it started behaving as expected.
Refreshing once before the calling action, and once again after it.

I think I must have missed something from the docs, but can anyone
tell me why the lack of the slash in the topic name causes this
behavior?

Thx for the help.

Felipe Fraga


On Fri, Dec 26, 2008 at 11:27 AM, Felipe Fraga <felipefr...@gmail.com> wrote:
> Hello,
>
> Thanks for the reply. I had already read that post. In fact I am
> trying to do something a lot simpler. I don't need to write dojo
> scripts to publish the topics, since I am not using any events other
> then the submit button of the form.
>
> My example works "fine", I just have the problem that the div
> listening to the topic refreshes several times before the published
> action executes and another several times after the published action
> executes.
>
> And answering to your second question, I did not write any javascript
> for this. I am just using the notify topics and listen topics
> attributes of the submit and div Struts 2 tag libs.
>
> Hope this can make it clearer.
>
> Thanks a lot.
>
> Felipe Fraga
>
> On Fri, Dec 26, 2008 at 6:21 AM, MyAshok <takumar....@gmail.com> wrote:
>>
>> hi,
>>
>> Did you wrote any javascript for your notify topics.
>>
>>
>> With regards,
>> Ashok
>>
>>
>>
>> Felipe Fraga wrote:
>>>
>>> Greetings all,
>>>
>>> I'm having trouble understanding the notify/listen topics dynamics.
>>>
>>> According to the following link in the "notify topics scenario":
>>> http://struts.apache.org/2.0.11/docs/ajax-tags.html
>>>
>>> When a DIV listens to a topic that is being notified, it should be
>>> refreshed once before the execution of the action, and one more time
>>> after the action completes. In my case, it is being refreshed several
>>> times before and another several times after. The number of times
>>> seems to be randomic.
>>>
>>> I have the following JSP with 2 DIVs. The one on the bottom listens to
>>> a Topic notified by a submit that is in another JSP, more precisely,
>>> in the JSP loaded on the upper div.
>>>
>>> Below is the DIVs structure:
>>>
>>> <fieldset>
>>>       <legend>Operator Form</legend>
>>>       <s:url id="urlShowSaveOperatorForm" namespace="/users"
>>> action="saveOperator!input" />
>>>       <s:div
>>>                       id="divSaveOperator"
>>>                       href="%{urlShowSaveOperatorForm}"
>>>                       theme="ajax"
>>>                       loadingText="Loading operator form..."
>>>                       cssClass="innerdiv" />
>>> </fieldset>
>>>
>>> <br>
>>>
>>> <fieldset>
>>>       <legend>Operators Listing</legend>
>>> <s:url id="urlShowOperatorsListing" namespace="/users"
>>> action="showOperatorsListing" />
>>> <s:div
>>>               id="divOperatorsListing"
>>>               href="%{urlShowOperatorsListing}"
>>>               theme="ajax"
>>>               listenTopics="updateOperatorsListing"
>>>               loadingText="Loading operators listing..."
>>>               cssClass="innerdiv" />
>>> </fieldset>
>>>
>>> And below there is the submit that notifies the topic:
>>>
>>> <s:submit value="Update"
>>> targets="divSaveOperator"
>>> notifyTopics="updateOperatorsListing"                                       
>>>             loadingText="Loading
>>> operator's form..." />
>>>
>>> Still below, there is my log of the actions execute methods being
>>> called. You can notice the method of the refresh list being called
>>> several times before and anfter the Save Profile method.
>>>
>>> 15:34:22,706 INFO  [ShowProfilesListingAction] ::: Executing Profiles
>>> Listing
>>> 15:34:22,780 INFO  [ShowProfilesListingAction] ::: Executing  Profiles
>>> Listing
>>> 15:34:22,797 INFO  [SaveProfileAction] ::: Executing  Save Profile
>>> 15:34:22,819 INFO  [ShowProfilesListingAction] ::: Executing  Profiles
>>> Listing
>>> 15:34:22,841 INFO  [ShowProfilesListingAction] ::: Executing  Profiles
>>> Listing
>>> 15:34:23,146 INFO  [ShowProfilesListingAction] ::: Executing  Profiles
>>> Listing
>>> 15:34:23,197 INFO  [ShowProfilesListingAction] ::: Executing  Profiles
>>> Listing
>>> 15:34:23,219 INFO  [ShowProfilesListingAction] ::: Executing  Profiles
>>> Listing
>>> 15:34:23,241 INFO  [ShowProfilesListingAction] ::: Executing  Profiles
>>> Listing
>>>
>>> Can anybody help me?
>>>
>>> Thanks a lot.
>>>
>>> Felipe Fraga
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/Notify-Listen-Topics-dynamics-tp21168939p21172613.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to