You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Jakob B <co...@hotmail.com> on 2004/11/25 14:23:01 UTC
problems with dropdownmenu
I want to make a dropdownmenu, with persons names from a database:
#set ($Persons = $test.getAllStateflow()) --- gets a List from a peerclass
with data(name, age, adress)
<p>name:<br>
<select name="name">
#foreach( $array in $Persons )
#indexedRows($velocityCount)
<option>$array.getName</option>
#end
?
_________________________________________________________________
Opret en gratis Hotmail-konto http://www.hotmail.com med udsigt til 250 MB
lagerkapacitet
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
Re: problems with dropdownmenu
Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
On Thu, 2004-11-25 at 13:23 +0000, Jakob B wrote:
> I want to make a dropdownmenu, with persons names from a database:
Jakob, questions like this are best directed to the users list.
> #set ($Persons = $test.getAllStateflow()) --- gets a List from a peerclass
> with data(name, age, adress)
>
> <p>name:<br>
> <select name="name">
>
> #foreach( $array in $Persons )
> #indexedRows($velocityCount)
> <option>$array.getName</option>
> #end
#indexedRows()? Isn't that macro from Scarab
<http://scarab.tigris.org/>? And doesn't it generate <tr>'s, which are
inappropriate inside a <select> widget?
You'll need to close your </select>. You'd need to either:
1) Include the parens when calling the getName method:
<option>$array.getName()</option>
or...
2) Use the method name in a JavaBean-like fashion:
<option>$array.Name</option>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org