> with velocity, I need to write a macro to display which radio value is
> selected, 
Yep, that's correct, but pretty easy, and one advantage over the bean
tag is that you see exactly what the HTML looks like and can change it
without recompiling the taglib. :-)

I use a macro like this one for a Yes/No/Unknown radio buttons:

#macro ( YesNoInput $fieldname $value)
    #if (! $value ) #set ($value = "") #end
    #set ($s=0)
    <input type="radio" value="Y"   name="$fieldname" #if ($value == "Y"
|| $value == "YES") #set ($s=1) checked #end >Yes
    <input type="radio" value="N"   name="$fieldname" #if ($value == "N"
|| $value == "NO" ) #set ($s=1) checked #end >No
    <input type="radio" value="UNK" name="$fieldname" #if ($s == 0)
checked #end>Unknown
#end

#YesNoInput ("happyCamper" $myForm.HappyCamper)


> and worse when the form is submitted, I need to go 
> through the request parameters to set the correct value.
Hmm... Velocity just creates the HTML, so just like the taglib, after
submission the Struts form is taking over and doing it's thing. There
might just be a field naming typo or something simple like that. I
wouldn't suspect Velocity has anything to do with it at this point.

> Man, I'd regret of not using velocity because of this!
> Any idea, suggestion is appreciated!
Heh heh... I don't think that will be necessary. :-)

Timo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to