struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Pussep <an...@pussep.de>
Subject Re: Method prefix with additional parameters
Date Tue, 12 Jun 2007 13:29:15 GMT
Sorry for the annoyance, I found the answer myself by trying a thing I
never expected to work. I just encapsulated a param-tag with the
submit-tag and it worked... Nice!

Thanks and sorry for the unnecessary request,
Anton

Anton Pussep wrote:
> Hello,
> 
> I am using method prefix in order to be able to forward the form content
> to different methods in my action class. Now I need several buttons that
> call all the same method, but a parameter shall tell the method what to
> do (e.g. which entry to delete in an ArrayList). Is there a way to pass
> a parameter when a button is clicked (but that is not passed, if another
> one is clicked)?
> 
> Here is a small example illustrating what I would like to do:
> 
> <s:iterator value="names">
>   <s:property />
>   <s:submit name="method:remove" value="Remove" />
> </s:iterator>
> 
> When the button behind a name is clicked the action class shall remove
> the name from its list. The action class contains an ArrayList of names
> and has a getter "public ArrayList getNames() {return names;}"
> 
> Best,
> Anton
> 


Mime
View raw message