<HTML>
<style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>Hi Mike,<br>
<br>
I was trying your solution, but I'm still a bit confused.<br>
<br>
This is my current code (within Legend.LegendRenderer)<br>
<br>
this.executeRasterQueryAction = new Jx.Action(OpenLayers.Function.bind(this.getRasterQuery, this));<br>
this.executeRasterQueryItem = new Jx.MenuItem(this.executeRasterQueryAction, {label: OpenLayers.i18n('Execute raster query')});<br>
<br>
According to your explanation, the first line should then be:<br>
<br>
this.executeRasterQueryAction = new
Jx.Action(OpenLayers.Function.bind(this.getRasterQuery, this, layer));<br>
<br>
Or am I wrong here? But how do I get the reference to the layer thats clicked? Does that make sense what I'm saying? :) I'm not really into the whole binding stuuf yet. Getting there though...<br>
<br>
Cheers,<br>
Tom<br>
<br>
<br>
<br>
<span style="font-weight: bold;">On Thu 15/04/10 15:52 , Mike Adair madair@dmsolutions.ca sent:<br>
</span><blockquote style="border-left: 2px solid rgb(245, 245, 245); margin-left: 5px; margin-right: 0px; padding-left: 5px; padding-right: 0px;">Tom,<br>
<br>
The menu items are only bound to the legend tree items/folders at this <br>
point. I think what you would need to do is bind whatever object you <br>
need when setting up your onclick event, eg. the existing code looks like:<br>
onClick: <br>
OpenLayers.Function.bind(this.collapseBranch, this, this.oRoot)<br>
<br>
but you probably want:<br>
<br>
onClick: <br>
OpenLayers.Function.bind(this.collapseBranch, this, this.oRoot, layer)<br>
<br>
(or similar) and then in the method being bound, layer will appear as <br>
one of the arguments.<br>
<br>
<br>
Mike<br>
<br>
<br>
Tom van der Putte wrote:<br>
<span style="color: rgb(102, 102, 102);">> Hi All,</span><br>
<span style="color: rgb(102, 102, 102);">></span><br>
<span style="color: rgb(102, 102, 102);">> When right-clicking an item in the legend, a context manu appears. </span><br>
<span style="color: rgb(102, 102, 102);">> I've added a entry to this menu, and clicking on it results in a </span><br>
<span style="color: rgb(102, 102, 102);">> certain function beeing executed. However, I want to check if the item </span><br>
<span style="color: rgb(102, 102, 102);">> that was right-clicked in the legend is of a certain type. How can I </span><br>
<span style="color: rgb(102, 102, 102);">> get to the layer name? I found something like targetFolder in the </span><br>
<span style="color: rgb(102, 102, 102);">> legend widget, but this obviously goes only for the folders?</span><br>
<span style="color: rgb(102, 102, 102);">></span><br>
<span style="color: rgb(102, 102, 102);">> Cheers,</span><br>
<span style="color: rgb(102, 102, 102);">></span><br>
<span style="color: rgb(102, 102, 102);">> Tom</span><br>
<span style="color: rgb(102, 102, 102);">> ------------------------------------------------------------------------</span><br>
<span style="color: rgb(102, 102, 102);">></span><br>
<span style="color: rgb(102, 102, 102);">> _______________________________________________</span><br>
<span style="color: rgb(102, 102, 102);">> fusion-users mailing list</span><br>
<span style="color: rgb(102, 102, 102);">> <a href="javascript:top.opencompose('fusion-users@lists.osgeo.org','','','')">fusion-users@lists.osgeo.org</a></span><br>
<span style="color: rgb(102, 102, 102);">> <a target="_blank" href="parse.php?redirect=http%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Ffusion-users"><span style="color: red;">http://lists.osgeo.org/mailman/listinfo/fusion-users</span></a></span><br>
<span style="color: rgb(102, 102, 102);">> </span><br>
<br>
-- <br>
Michael Adair<br>
Senior Software Architect<br>
DM Solutions Group Inc.<br>
<br>
Office: (613) 565-5056 x26<br>
<a href="javascript:top.opencompose('madair@dmsolutions.ca','','','')">madair@dmsolutions.ca</a><br>
<a target="_blank" href="parse.php?redirect=http%3A%2F%2Fwww.dmsolutions.ca"><span style="color: red;">http://www.dmsolutions.ca</span></a><br>
<a target="_blank" href="parse.php?redirect=http%3A%2F%2Fresearch.dmsolutions.ca"><span style="color: red;">http://research.dmsolutions.ca</span></a><br>
<br>
<br>
<br>
</blockquote></HTML>