webwork / src / java / template / archive / simple / select.vm

<select name="$!webwork.htmlEncode($parameters.name)"
    #if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"         #end
    #if ($parameters.disabled)         disabled="disabled"                                   #end
    #if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)" #end
    #if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"             #end
    #if ($parameters.multiple)         multiple="multiple"                                   #end
    #if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"    #end
    #if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"    #end
    #parse("/$parameters.templateDir/simple/scripting-events.vm")
>

#if ($parameters.headerKey && $parameters.headerValue)
    <option value="$!webwork.htmlEncode($parameters.headerKey)">$!webwork.htmlEncode($parameters.headerValue)</option>
#end

#if ($parameters.emptyOption)
    <option value=""></option>
#end

#set( $items = $parameters.list )
#if( $items )
    #foreach( $item in $items )
        $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

        <option value="$!webwork.htmlEncode($itemKey)"#if( $tag.contains($parameters.nameValue, $itemKey) ) selected="selected"#end>$!webwork.htmlEncode($itemValue)</option>

        #set ($trash = $stack.pop())
    #end
#end

</select>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.