<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Users,<br>
<br>
i've some issues with using a Button to show/hide a Layer in my map.<br>
<br>
1. "checked:true" doesn't work<br>
2. I get an error whne first check and uncheck the button:<span
class="errorMessage "><br>
this.control is undefined</span><span class=" "></span>
<div role="listitem" class="errorSourceBox errorSource-show focusRow
subLogRow "><a title="this.control.activate();" class="errorSource
a11yFocus "> this.control.activate();<br>
<span class="errorMessage "> this.control is
undefined</span><span class=" "></span>
</a>
<div role="listitem" class="errorSourceBox errorSource-show
focusRow subLogRow "><a title="this.control.activate();"
class="errorSource a11yFocus ">
this.control.deactivate();
</a></div>
<br>
3. Afterwards the button seems to work, but unchecking it doesn't
affect the Layer (it stays visible).<br>
<br>
CODE:<br>
<font color="#000000"> var action1 = new GeoExt.Action({<br>
text: 'Sites',<br>
map: map,<br>
tooltip: 'NESPOS - SITES',<br>
enableToggle: true,<br>
handler: function(toggled){<br>
if (toggled) {<br>
nespos.setVisibility(true);<br>
} else {<br>
nespos.setVisibility(false);<br>
}<br>
},<br>
checked: true<br>
});<br>
actions["Sites"] = action1;<br>
toolbarItems.push(action1);<br>
toolbarItems.push("-");</font><br>
<a title="this.control.activate();" class="errorSource a11yFocus "></a></div>
<br>
<br>
Kind regards,<br>
<br>
Kai<br>
</body>
</html>