1. opensymphony
  2. webwork

Source

webwork / src / java / template / xhtml / checkboxlist.vm

#parse( "/template/xhtml/controlheader.vm" )
#set( $items = $parameters.list )
#if( $items )
    #set( $itemCount = 0 )
    #foreach( $item in $items )
        #set( $itemCount = $itemCount + 1)
        $stack.push($item)
        #if( $parameters.listKey )
            #set( $itemKey = $stack.findValue($parameters.listKey) )
        #else
            #set( $itemKey = $item )
        #end
        #if( $parameters.listValue )
            #set( $itemValue  = $stack.findValue($parameters.listValue) )
        #else
            #set( $itemValue = $item )
        #end
        <div>
         <input type="checkbox" name="$!webwork.htmlEncode($parameters.name)" value="$!webwork.htmlEncode($itemKey)"
         id="$!webwork.htmlEncode($parameters.name)-$itemCount" #if( $tag.contains($parameters.nameValue, $itemKey) ) checked="true" #end/>
         <label for="$!webwork.htmlEncode($parameters.name)-$itemCount" class="checkboxLabel">$!webwork.htmlEncode($itemValue)</label>
        </div>
        #set ($trash = $stack.pop())
    #end
#else
  &nbsp;
#end
#parse( "/template/xhtml/controlfooter.vm" )