Hi
I'm afraid the map is behind closed doors. I mocked up a demo and have
the answer.
As you stated, with a regular infowindow the state of a checkbox/radio
isn't preserved when reopened. I have discovered that the state is
preserved in an infowindow if there are tabbed windows.
Here's the sample initialize function i used.
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
var marker = new GMarker(new GLatLng(37.4419, -122.1419));
var tabs = [];
var slotDivStart = "<div>";
for(var sPtr=0; sPtr < 5; sPtr++) {
slotDivStart = slotDivStart + "<label id=\"mapLabel\"><span
class=\"mapText\">Assign Slot " + sPtr + "</span><input type=\"radio\"
name=\"slotRadio\" /></label><br />";
}//for
var slotDivEnd = "</div>";
var radioHtml = slotDivStart + slotDivEnd;
var checkHtml = "<input type=\"checkbox\" id=\"showNodes\" name=
\"showNodes\" />";
tabs.push(new GInfoWindowTab("Radio", radioHtml));
tabs.push(new GInfoWindowTab("Check", checkHtml));
marker.bindInfoWindowHtml(tabs);
map.addOverlay(marker);
}
}
</script>
Thanks
On Aug 25, 5:47 pm, "[email protected]" <[email protected]>
wrote:
> On Aug 25, 8:46 am, scott bradley <[email protected]>
> wrote:
>
> > This is what i thought until i saw my radio buttons keeping their
> > state.
>
> Where is your map that shows that
> behavior?http://groups.google.com/group/Google-Maps-API/web/suggested-posting-...http://groups.google.com/group/google-maps-api/web/why-including-a-li...
>
> -- Larry
>
>
>
> > On Aug 25, 2:59 pm, "[email protected]" <[email protected]>
> > wrote:
>
> > > On Aug 25, 6:41 am, scott bradley <[email protected]>
> > > wrote:
>
> > > > Hi
>
> > > > I have an issue where a checkbox in an infowindow loses it's state
> > > > after the infowindow is closed. For example, I click the checkbox to
> > > > perform a task, then close the infowindow. When I open the infowindow
> > > > again the checkbox has reset to unchecked.
> > > > I'm not sure if this is supposed to happen, it doesn't happen with
> > > > radio buttons.
>
> > > > The code defining the checkbox is fairly straight forward and the id
> > > > and name are unique.
> > > > <input type=\"checkbox\" id=\"showNodes" + conduitId + "\" name=
> > > > \"showNodes" + conduitId + "\" onClick=\"initShowNodes(" + conduitId +
> > > > ");\" />
>
> > > > Any info appreciated.
>
> > > Unless you are doing something strange, the DOM for the infowindow is
> > > recreated when it is re-opened. How do you expect it to maintain its
> > > state unless you write code to do it?
>
> > > -- Larry
>
> > > > Thanks
> > > > Scott- Hide quoted text -
>
> > - Show quoted text -
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.