You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "G.L. Grobe" <ga...@grobe.net> on 2003/06/14 20:31:55 UTC

method arguments

I'm trying to pass in a parameter from a select control to a webwork 
velocity ActionSupport class method which returns a Map, but I'm pretty 
sure the $selectA param as shown below isn't being done correctly. Can 
anyone comment on this?

<select name="testType" style="width:190px" onChange="testAs()">
    foreach ( $key in $testCategories($selectA).keySet() )
       <option 
"value=$testCategories.get($key)">$testCategories.get($key)
    end
</select>

public Map getTestCategories(String[] tst) {
    ...

Any help much appreciated.


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


Re: method arguments

Posted by Terry Steichen <te...@net-frame.com>.
Hi Gary,

If I understand your question, I imagine that you have some class (say,
Doit.java) that includes the public method getTestCategories(whatever).  You
need to insert that class into the context as, say, "doit".  Then in the
template, refer to this as $doit.TestCategories(whatever) or
$doit.getTestCategories(whatever).

HTH,

Terry

----- Original Message -----
From: "G.L. Grobe" <ga...@grobe.net>
To: <ve...@jakarta.apache.org>
Sent: Saturday, June 14, 2003 2:31 PM
Subject: method arguments


> I'm trying to pass in a parameter from a select control to a webwork
> velocity ActionSupport class method which returns a Map, but I'm pretty
> sure the $selectA param as shown below isn't being done correctly. Can
> anyone comment on this?
>
> <select name="testType" style="width:190px" onChange="testAs()">
>     foreach ( $key in $testCategories($selectA).keySet() )
>        <option
> "value=$testCategories.get($key)">$testCategories.get($key)
>     end
> </select>
>
> public Map getTestCategories(String[] tst) {
>     ...
>
> Any help much appreciated.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>


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