Thanks Miguel, but that doesn't sound workable with an arbitrary number of
buttons.

Anyone else? 

I'm looking for a method of dealing with a table with each row having a
"remove" button. I need to pass a different rowId based on which button is
clicked so I know which row to remove.
I need to use a form (not a link) as there are other input fields that need
to be submitted with the request.

Is there a struts pattern for this?


Miguel-55 wrote:
> 
> You can use the method attribute in the s:submit button, combined with
> a method in your action. You could use the different method invocation
> as an implicit parameter.
> You may need to use the action wildcard feature in struts.xml
> 
> Si quieres ser más positivo, pierde un electrón
> Miguel Ruiz Velasco S.
> 
> 
> 
> On Fri, Jan 30, 2009 at 15:54, Greg Lindholm <glindh...@yahoo.com> wrote:
>> I have a CRUD action and jsp page for an entity, this entity has a list
>> of attributes. I display these attributes in a table one per row.
>> What I would like to do is have a <s:submit action="removeAttr"/> button
>> on each row of the table so the user can click on the button to remove
>> the attribute.
>> In order to make this work I would need to pass the id of the attribute
>> with the submit button and I can't find a way to do this.
>>
>> Is there a (struts) way to pass a parameter with a submit button?
>>
>> I can't use a link because I need all the other form fields to be posted
>> with the request.
>>
>> The only way I can think of making this work is to add some javascript to
>> each button that would set the id in a hidden field before the submit. Is
>> there a pure struts or better way to do this?
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Passng-a-parameter-with-%28multiple%29-Submit-buttons-tp21756353p21792399.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to