Customizing the selection panel

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Customizing the selection panel

Kevin

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
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Reply | Threaded
Open this post in threaded view
|

Re: Customizing the selection panel

zspitzer
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
<[hidden email]> 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
> [hidden email]
> 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
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Reply | Threaded
Open this post in threaded view
|

RE: Customizing the selection panel

Kevin
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:[hidden email]]
Sent: maandag 29 augustus 2011 15:02
To: Kevin Pelgrims
Cc: [hidden email]
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 <[hidden email]> 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
> [hidden email]
> 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

_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Reply | Threaded
Open this post in threaded view
|

RE: Customizing the selection panel

Kevin
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: [hidden email] [mailto:[hidden email]] On Behalf Of Kevin Pelgrims
Sent: maandag 29 augustus 2011 16:23
To: Zac Spitzer; [hidden email]
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:[hidden email]]
Sent: maandag 29 augustus 2011 15:02
To: Kevin Pelgrims
Cc: [hidden email]
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 <[hidden email]> 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
> [hidden email]
> 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

_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Reply | Threaded
Open this post in threaded view
|

Re: Customizing the selection panel

makoychan
In reply to this post by Kevin
What does it mean to make a new build? how do i do that?

I am trying to access functions on the legends and selection panel because i wanted to refresh its content.