Hi!

Still finding little problems upgrading from 5.0.11 to 5.0.17.  Here is my
latest issue:

I was using prototype's Ajax.PeriodicalUpdater to do polling by refreshing a
zone.  My code goes like this:

component tml:

        <t:actionlink t:id="pollLink" zone="pollResults">Poll</t:actionlink>
        <t:zone t:id="pollResults"/>
        <t:block id="pollResultsBlock"> ${gameId} </t:block>

component java:

        @Inject
        private Block pollResultsBlock;

        @OnEvent(component = "pollLink")
        Block poll() {
                return pollResultsBlock;
        }

        public int getGameId() {
                return this.gameId;
        }

I inject this javascript:

var url = $("pollLink").href;
var updater = new Ajax.PeriodicalUpdater('pollResults', url, {
        asynchronous:true,
        frequency:2,
        evalJS:true,
        onLoaded: function(transport) {
                $("pollResults").style.display = "none";
                var result = $("pollResults").innerHTML;
                eval("gameId = " + result + "['content']");
// do some stuff with gameId
        }
});


All this used to word in 5.0.11, but in 5.0.17, although the ActionLink
works if I click it manually, the PeriodicUpdate now fails.  Instead of
putting gameId in the block, I get the entire contents of the page.  In
fact, the poll() method is never even invoked unless I click the link
manually.

Moreover, I'd like to know if there is some right way to do polling via
Ajax.  Notwithstanding the fact that it no longer works, my method seems
like a horrible hack...

Thanks again,
Marc

-- 
View this message in context: 
http://www.nabble.com/Ajax-polling-using-zone-tp20873920p20873920.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to