velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vlachogiannis Evangelos <evl...@aegean.gr>
Subject Problem with macro
Date Thu, 10 Apr 2003 12:10:14 GMT
Hi all, I am wrote a vel macro with resource->hashtable ...


#macro (myformListBox $mylabel $myname $mykeyset $myselected)
<tr>
  <td bgcolor="$!{skin.TitleBackgroundColor}">
    <b>
      <font face="$ui.sansSerifFonts">
        $mylabel
      </font>
    </b>
  </td>
  <td bgcolor="$!{skin.TitleBackgroundColor}">
  	<select name=$myname >          		
					#foreach( $key in $mykeyset )
						#if ($key != $myselected)
							<option
value="$key">$mykeyset.get($key)</option>
						#else
							<option value="$key"
SELECTED>$mykeyset.get($key)</option>
						#end
					#end
		      	</select>
  </td>
 </tr>
#end

I call it like this ...

#myformListBox("Resource Type" "resource_type_id" $resnames
$!resource.getResourceId().toString())


And getting ...

<tr>
  <td bgcolor="#dddddd">
    <b>
      <font face="$ui.sansSerifFonts">
        Resource Type
      </font>
    </b>
  </td>
  <td bgcolor="#dddddd">
  	<select name=resource_type_id >          		
		<option value="type2">$mykeyset.get($key)</option>
		<option value="type1">$mykeyset.get($key)</option>
	</select>
  </td>
 </tr>

I suppose to get ...

<tr>
  <td bgcolor="#dddddd">
    <b>
      <font face="$ui.sansSerifFonts">
        Resource Type
      </font>
    </b>
  </td>
  <td bgcolor="#dddddd">
  	<select name=resource_type_id >          		
		<option value="1">type2</option>
		<option value="2">type1</option>
	</select>
  </td>
 </tr>


Any ideas please?????

Thnx 
Vangelis

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message