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?
>