users@woodstock.java.net

Re: upgrade from 4.1.1 to 4.2 breaks subscribe

From: Steven Bell <bell.steven_at_gmail.com>
Date: Thu, 20 Mar 2008 07:21:47 -0700

I did look at the TLD's. Actually below is from the TLD's and I can't
see any difference (other than the component ID and the var name)
between it and my code. I was just wondering if I was missing
something obvious, but it doesn't look like it. I'll just have to
stay on 4.1.1 until I have time to really dig into it.

<webuijsf:script>
    var processEvents = {
        update: function(props) {
            // Do something...
        }
    }

    // Subscribe to refresh event.
    var domNode = document.getElementById("form1:test1");
    domNode.subscribe(domNode.event.refresh.endTopic, processEvents, "update");

</webuijsf:script>

On Mon, Mar 17, 2008 at 2:11 PM, Dan Labrecque <Dan.Labrecque_at_sun.com> wrote:
>
> 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?
>
>
>



-- 
Regards,
Steven Bell