[fusion-users] Panels and instantiations.

Chris Claydon chris.claydon at autodesk.com
Fri May 30 12:06:30 EDT 2008


Hi Tómas,

I think your widget needs to inherit from the base Widget class...

    initialize : function(widgetTag) {
        Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);

 'paramRegister' is defined in that base class.

Chris.

From: fusion-users-bounces at lists.osgeo.org [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Tómas Guðmundsson
Sent: May 30, 2008 9:32 AM
To: fusion-users at lists.osgeo.org
Subject: RE: [fusion-users] Panels and instantiations.

Hey all.

I'm getting errors with a pretty much empty widget.

Fusion Error: WARNING: Error occurred in AJAX callback. TypeError: widget.paramRegister is undefined File: undefined (77) xx)

When I do console.log(widget.paramRegister) for Legend.js I get undefined. I don't know what this is about.

This is what I have in AppDef.xml

     <Widget xsi:type="WidgetType">
       <Name>Information</Name>
       <Type>Information</Type>
       <StatusItem/>
     </Widget>

And my stuff get's called, I'm just getting this error. Seems like one more thing is missing for it to work properly.

Information.js
Fusion.Widget.Information = Class.create();
Fusion.Widget.Information.prototype =
{
    initialize : function(widgetTag) {
        console.log('InformationPanel.initialize');
        var json = widgetTag.extension;
        console.log(widgetTag); // logs  = Object type=Information name=Information location=widgets/
    },
}

Cheers
Tómas

From: fusion-users-bounces at lists.osgeo.org [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Tómas Guðmundsson
Sent: 30. maí 2008 13:15
To: Jason Fournier
Cc: fusion-users at lists.osgeo.org
Subject: RE: [fusion-users] Panels and instantiations.

Hi Jason.

Yes this was what I was looking for. Just got back from lunch so I'll look into it.  It looks to me like that is how you get a new Widget *in* to a panel like Paul talked about. I have currently mastered the Jx.Panels and done something cool with them. I thought of an idea that might be bad it might be good, don't know 100% how this was designed. But if some widget's like the Legend would Inherit or extend a Jx.Panel so functionality of a panel might be configurable / controllable by the widget itself. For instance, when a panel is maximized (which I think is no way for the widget Legend to find out) it might call for a selection in the map and do something with that. Just wandering right now, there might be some hidden functionality in there.

Regards,
Tómas.

From: fusion-users-bounces at lists.osgeo.org [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Jason Fournier
Sent: 30. maí 2008 11:44
To: fusion-users at lists.osgeo.org
Subject: RE: [fusion-users] Panels and instantiations.

Hi Tomas,

If I follow you correctly I seem to recall Panels getting created in Jx and then applying a content.id to attach to a widget in the AppDef:

    var p1 = new Jx.Panel({label: 'Legend'});
    p1.content.id = 'Legend';

in your AppDef you'd have a widget with Name Legend.

This was a while ago so things might have changed since.

Best regards,
Jason



From: fusion-users-bounces at lists.osgeo.org [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Tómas Guðmundsson
Sent: Friday, May 30, 2008 7:24 AM
To: fusion-users at lists.osgeo.org
Subject: [fusion-users] Panels and instantiations.

Hi all.

I am trying to figure out how and where widget's like TaskPane and Legend.js get instantiated ? Is it onely from ApplicationDefinition.xml  or is it somewhere called in fusion.js or fusion.combined.js ? Any help to how to construct a Panel Widget would be very helpful.

Regards
Tómas from the very recently earthquake shooken Iceland.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fusion-users/attachments/20080530/99366693/attachment.html


More information about the fusion-users mailing list