[fusion-users] Widget Functions.

Mike Adair madair at dmsolutions.ca
Wed May 14 09:51:43 EDT 2008


Also, widgets must be associated with a DOM element to be instantiated.  
This can be either through a <Container><Item> element, or simply 
through a <div id='widgetName'> element in the page (I think this 
works).  You can try putting a breakpoint in the widget constructor to 
see if it ever gets instantiated.

Mike

Alan Boudreault wrote:
> Where is defined you class sneBlockUI ? Can you check with firebug if 
> the file you defined this class is well loaded ? Fusion does'nt load 
> all the "TheWidget.js" files by default,  only those that are 
> required. (Those defined in the ApplicationDefinition.xml)
>
> Regards,
> Alan
>
> Tómas Guðmundsson wrote:
>> Yeah,
>>
>> Here are the errors I get via firebug.
>> Fusion.Widget.sneBlockUI is not a constructor
>>  - this.blocker = new Fusion.Widget.sneBlockUI();  --- 
>> sneRefreshMap.js (line 8)
>> blockUI is not defined
>>  - blockUI(); --- sneRefreshMap.js (line 16)
>>
>> What I am aiming for is this blocking of the ui while the map is 
>> rendering so maybe I should just modify the Map.js ?
>> However here is the code.
>>
>> Fusion.Widget.sneRefreshMap = Class.create();
>> Fusion.Widget.sneRefreshMap.prototype =  {
>>     initialize : function(widgetTag) {
>>         //console.log('RefreshMap.initialize');
>>         Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, 
>> true]);
>>         Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
>>         this.dialog = null;
>>         this.blocker = new Fusion.Widget.sneBlockUI();
>>     },
>>
>>     /**
>>      * execute function.
>>      */
>>     execute : function() {
>>         var map = this.getMap();
>>         blockUI();
>>         map.redraw();                   },
>>         blockUI : function() {
>>         if (!this.dialog) {
>>         var size = Element.getPageDimensions();
>>         var o = {
>>             title: OpenLayers.String.translate('Loading'),
>>             id: 'Loading',
>>             imageBaseUrl: this.imageBaseUrl,
>>             width: 150,
>>             height: 85,
>>             resizeable: false,
>>             top: (size.height-200)/2,
>>             left: (size.width-320)/2,
>>         };
>>     this.dialog = new Jx.Dialog(o);
>>     }
>>
>>         this.dialog.open();            }
>> };
>>
>> -----Original Message-----
>> From: Paul Spencer [mailto:pspencer at dmsolutions.ca] Sent: 14. maí 
>> 2008 11:25
>> To: Tómas Guðmundsson
>> Cc: fusion-users at lists.osgeo.org
>> Subject: Re: [fusion-users] Widget Functions.
>>
>> I'm not sure about the first error, can you send code for us to look at?
>>
>> For the second, try:
>>
>> var myObject = new Fusion.Widget.MyNewWidget();
>>
>> Paul
>>
>> On 14-May-08, at 5:57 AM, Tómas Guðmundsson wrote:
>>
>>  
>>> Hi all.
>>>
>>> I have been wondering about a very strange "bug" but then again 
>>> this  might be something that you don't notice until you've told 
>>> everybody  about it and feel like a complete idiot.
>>>
>>> I'm trying to create a code that extends the refresh widget by  
>>> opening up a ui-blocking page like the Print widget does. However,  
>>> if I just use the pure code from Print.js, like copy/paste. Firebug  
>>> gives me an error that the function can not be found. Totally  
>>> cryptic to me. It is defined exactly like the Print.js widget, do I  
>>> need to define my functions somewhere else ?
>>>
>>> Also, if I have created a seperate widget that I want to use just  
>>> like a new class in a conventional programming, like so.
>>>
>>> var myObject = new MyNewWidget();
>>>
>>> Do I need to call Fusion.Class or something ?
>>>
>>> Thanks
>>> Tomas
>>> _______________________________________________
>>> fusion-users mailing list
>>> fusion-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>>>     
>>
>>
>> __________________________________________
>>
>>     Paul Spencer
>>     Chief Technology Officer
>>     DM Solutions Group Inc
>>     http://www.dmsolutions.ca/
>>
>> _______________________________________________
>> fusion-users mailing list
>> fusion-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>>   
>
>


More information about the fusion-users mailing list