users@woodstock.java.net

Re: upgrade from 4.1.1 to 4.2 breaks subscribe

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Mon, 17 Mar 2008 16:11:58 -0500

Woodstock 4.2 uses a custom version of Dojo. (Please see the release
notes.) In order to subscribe to an event, your code will look something
like this:
|
    // Subscribe to submit event.
    var domNode = document.getElementById("form1:test1");
    domNode.subscribe(domNode.event.submit.endTopic, listener,
listener.notify);
|||
Please see the TLD docs below for updated examples.

    http://webdev2.sun.com/woodstock-tlddocs

Dan

Steven Bell wrote:
> Hello,
>
> I'm trying to upgrade from 4.1.1 to 4.2, but I can't seem to get my
> subscribes to work.
>
> Under 4.1.1 I used the following code (this is one of a few that I
> have, but all the same pattern). The init method is called
>
> <w:body id="body" onLoad="setTimeout('init();',0);"
>
> function UpdateFriends(props){
> if(props.id != this.srcID) { return; }
> setTimeout('doRefresh();',0);
> };
>
> HeaderDropDownListener.prototype.notify = UpdateFriends;
>
> function init(){
> /*
> * Event Listeners.
> */
> var listener = new HeaderDropDownListener();
> dojo.subscribe(webui.suntheme.widget.dropDown.event.submit.endTopic,listener,listener.notify);
> }
>
> Based on the release notes for 4.2 I changed that to the following.
>
> <w:body id="body" onLoad="setTimeout('init();',0);"
>
> var UpdateFriends = {
> update: function(props) {
> if(props.id != this.srcID) { return; }
> setTimeout('doRefresh();',0);
> }
> };
>
> function init(){
> /*
> * Event Listeners.
> */
> var domNode = document.getElementById("PayableForm:totalDueCurrency");
> domNode.subscribe(domNode.event.submit.endTopic, UpdateFriends , "update");
> }
>
> Any ideas?
>