[Chameleon] LegendTemplate Widget - Combining checkbox and radiobutton layer selection

Delfos, Jacob Jacob.Delfos at maunsell.com
Tue Jun 13 19:44:37 EDT 2006


Jessica,
 
I think you could get away with modifying the bit around line 539-575 of
LegendTemplate.widget.php, and then making sure that the name of the
inputtype of the radiobuttons in your legendtemplate is set to something
other than "legendgroupname". Alternatively, you could put radiobuttons
in your template, and use "onChange" and some javascript to change the
value of hidden form elements, to turn layers on or off. But that might
be more complicated.
 
regards,
 
Jacob
 


________________________________

	From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Jessica
Deegan
	Sent: 13 June 2006 23:17
	To: Chameleon-users
	Subject: [Chameleon] LegendTemplate Widget - Combining checkbox
and radiobutton layer selection
	
	
	Greetings List,
	 
	I am using an instance of LegendTemplate to control layer
selection via a Mapserver HTML template.
	 
	My problem is that I want to combine the use of both checkboxes
(for overlay kinds of layers) and radio buttons (for backgrounds).  I
have metadata in the mapfile that indicates this status. (a snippet of
code from the template is below)
	 
	Unfortunately, because the name element is the same for both
radio and checkbox inputs, a selection of a radio button will turn off
all the checkboxes (problem is limited to Internet Explorer).
	 
	I can't seem to track down where "legendgroupname[]" has roots,
as I initially duplicated the legend widget and tried to rename the
variable in a new widget.
	
	Any advice is much appreciated!
	Best regards,
	Jessica
	 
	 
	**********************************
	  [if name=IsBackground oper=isnull]
	  <p>
	    <input type="checkbox" name="legendgroupname[]"
value="[leg_group_name]"
	    [if name=layer_status oper=eq  value=1]CHECKED [/if]
	    [if name=layer_status oper=eq value=2]CHECKED [/if]><span
class="label">[leg_group_name]</span>
	       </p>
	  [/if]
	  [if name=IsBackground oper=isset]
	     <p>
	    <input type="radio" name="legendgroupname[]"
value="[leg_group_name]"
	    [if name=layer_status oper=eq  value=1]CHECKED [/if]
	    [if name=layer_status oper=eq value=2]CHECKED [/if]>
&nbsp<span class="label">[leg_group_name]</span>     </p>
	  [/if]
	[/if]
	
	 
	****************************
	Jessica Deegan
	GIS Analyst
	Labor Market Information Office
	MN Dept of Employment and Economic Development
	332 Minnesota Street, Saint Paul, MN 55101
	(office) 651/296.3739 | (fax) 282.5429
	 
	http://www.deed.state.mn.us/lmi 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060614/3862c31a/attachment.html


More information about the Chameleon mailing list