You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Geir Magnusson Jr." <ge...@optonline.net> on 2002/03/18 14:25:13 UTC

Re: newbie question

On 3/19/02 7:18 AM, "Dmitri Colebatch" <di...@bigpond.net.au> wrote:

> hey all,
> 
> am I missing something obvious here.  I have the following template:
> 
>  <tr>
>     <td>Status: $story.Status</td>
>     <td><select name="status">
> #if( $story.Status == -2 )
>        <option value="-2" selected>Draft</option>
> #else
>        <option value="-2">Draft</option>
> #end
> #if( $story.Status == -1 )
>        <option value="-1" selected>Live</option>
> #else
>        <option value="-1">Live</option>
> #end
>      </select></td>
>  </tr>
> 
> but it produces:
> 
>  <tr>
>     <td>Status: -2</td>
>     <td><select name="status">
>        <option value="-2">Draft</option>
>        <option value="-1">Live</option>
>      </select></td>
>  </tr>
> 
> now from the vtl reference, I'm looking at:
> 
> a.. Equals Number: #if( $foo == 42 )
> 
> but I'm obviously missing something subtle (I hope its not obvious!).  Any
> pointers would be appreciated.
> 
> Of course then I need to get my head around tools, and the struts tools stuff
> (o:

What type is returned by $story.Status?  It should be an Integer.

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"Now what do we do?"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>