This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes sx tags's listenTopics gets called many many times! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "sx tags Watch "sx tags New topic

sx tags's listenTopics gets called many many times!

Yar lag

Joined: Apr 14, 2009
Posts: 10

I have a simple situation where inside a div, it has the following items:

<sx:autocompleter valueNotifyTopics="change" />
<sx:submit targets="windowframe" listenTopics="change" indicator="loader" cssStyle="display:none" />

The idea, is that when you select something in the autocompleter, it submits the form to somewhere.

Now everything works, it does submit. But the problem is, this div is loaded using <sx:div>'s ajax. That means this div can be loaded into the current document multiple times. And I find each time this div is loaded, the listenTopics get added once. So if I fire the ajax div 5 times, the form will be submitted 5 times when I choose something in the autocompleter! Any ideas how to fix this? Please help! Thank you!
I agree. Here's the link:
subject: sx tags's listenTopics gets called many many times!
It's not a secret anymore!