Thanks Jim, but I can't use a link, I need to submit the form as there are a bunch of other fields that need to get posted with the request.
Jim Kiley wrote: > > How bout: > <s:url id="deleteUrl" action="productList!delete"> > <s:param name="deleteProductId" value="id" /> > </s:url> > <s:a href="%{deleteUrl}">Delete</s:a> > > On Mon, Feb 2, 2009 at 11:37 AM, Greg Lindholm <glindh...@yahoo.com> > wrote: > >> >> Yes Musachy, that is correct. So is there some struts magic to do this? >> >> The only way I can think of doing this is to add some javascript to each >> button that would set the id as a hidden parameter before doing the >> submit. >> But I would prefer to do this without JS if possible. >> >> I guess what I'm thinking of would be an enhancement to the submit tag to >> allow passing an "id" in the same way you can pass the Action and Method. >> >> >> Musachy Barroso wrote: >> > >> > What you need to do is pass a different parameter on each submit, not >> > call a different method. >> > >> > musachy >> > >> > On Mon, Feb 2, 2009 at 11:06 AM, Greg Lindholm <glindh...@yahoo.com> >> > wrote: >> >> >> >> 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? >> >> >> >> >> >>> >> >>> 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-tp21756353p21793012.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 >> >> > > > -- > Jim Kiley > Technical Consultant | Summa > [p] 412.258.3346 [m] 412.445.1729 > http://www.summa-tech.com > > -- View this message in context: http://www.nabble.com/-S2--Passng-a-parameter-with-%28multiple%29-Submit-buttons-tp21756353p21793203.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