[fusion-users] Customizing the selection panel

Kevin Pelgrims Kevin.Pelgrims at realdolmen.com
Mon Aug 29 12:21:26 EDT 2011


Okay, after a lot of swearing and frustration, I just cheated ;-)
So here's one solution (feel free to let me know if there is a better way).

In the index file for the template you're using, in the fusionInitialized function, I added this:
mapWidget.registerForEvent(Fusion.Event.MAP_SELECTION_ON, OpenLayers.Function.bind(this.selectionOn, this));

Next step, add the handler and bind it to custom print function:
function selectionOn() {
  mapWidget.getSelection(printSelection);
}

Last step:
function printSelection(oSelection) {
  alert('test');
  var selectionPanel = $('SelectionPanel');
  selectionPanel.innerHTML = 'Put the stuff you want here!';
}

This is a short explanation of what I just did to adjust the selection panel. Maybe it's useful for somebody else later..

Regards,
Kevin


-----Original Message-----
From: fusion-users-bounces at lists.osgeo.org [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Kevin Pelgrims
Sent: maandag 29 augustus 2011 16:23
To: Zac Spitzer; fusion-users at lists.osgeo.org
Subject: RE: [fusion-users] Customizing the selection panel

Because I didn't really like the rebuilding option and found one additional website (http://trac.osgeo.org/fusion/wiki/HowToCustomizeSelectionPanel), I tried following:

I modified this in the ApplicationDefinition.xml:
    <Widget xsi:type="WidgetType">
      <Name>SelectionPanel</Name>
      <Type>SelectionPanel</Type>
      <StatusItem/>
      <Extension xsi:type="CustomContentType">
        <SelectionRenderer>displaySelection</SelectionRenderer>
      </Extension>
    </Widget>

I added the Extension part. Then I added this to index.html in one of the Fusion templates:
function displaySelection(oSelection)
{
    alert('BLAH!');
}

The alert is just there for testing purposes of course. This also does not work.
Is the information on that page obsolete, or am I doing something wrong here?

Is there really no other way then making a new build?
And if that is really required, how would I start with that?

Thanks for the reply.

Kevin

-----Original Message-----
From: Zac Spitzer [mailto:zac.spitzer at gmail.com]
Sent: maandag 29 augustus 2011 15:02
To: Kevin Pelgrims
Cc: fusion-users at lists.osgeo.org
Subject: Re: [fusion-users] Customizing the selection panel

you need to make a new build, all fusion js is compiled into a single file

On Mon, Aug 29, 2011 at 10:44 PM, Kevin Pelgrims <Kevin.Pelgrims at realdolmen.com> wrote:
> Hi list,
>
>
>
> I am trying to customize the selection panel in the Fusion viewer, but 
> so far I haven’t managed to change anything.
>
> I assumed all the code for the selection panel could be found in 
> SelectionPanel.js in the widget folder. But changes I make there don’t 
> seem to come through to the viewer. I have been looking at every place 
> possible, I don’t seem to find it.
>
> Can anybody guide me towards the right direction? Because I’m really 
> getting stuck here..
>
>
>
> Regards,
>
> Kevin
>
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
>



--
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168


More information about the fusion-users mailing list