struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adam pinder <apin...@hotmail.co.uk>
Subject RE: possible s:submit with parameter?
Date Mon, 08 Mar 2010 08:49:13 GMT

 

in the form, make your booklist a select box (with id as the option value) or display as text
with a radio button group (i.e. each book has the same radio button id) when you press submit,
the id of the book selected will be sent to the action and you can use that to retrieve the
book detail .....


 
> Date: Sun, 7 Mar 2010 10:26:39 -0600
> Subject: Re: possible s:submit with parameter?
> From: burtonrhodes@gmail.com
> To: user@struts.apache.org
> 
> Adam is correct. Every item filled out in the form is sent to your
> action. You can save these variables in the session or alternaitvely
> store them in each subsequent jsp with hidden form variables. You can
> use struts to display these properties/variables whereever you want. I
> think you are making your requirement more complicated than necessary.
> 
> On 3/6/10, lucas owen <sr.ilustre@gmail.com> wrote:
> > yes, of course...
> >
> > but imagine you have a list of elements, how do you pass the Id of the
> > element you want to display in other page with a s:submit???
> > (I cant use javascript)
> > 2010/3/6 Adam Pinder <apinder@hotmail.co.uk>
> >
> >> Any form textfield will be submitted when page submitted which is
> >> effectively a parameter.
> >>
> >> Adam
> >>
> >>
> >> On 5 Mar 2010, at 19:46, lucas owen <sr.ilustre@gmail.com> wrote:
> >>
> >> Hi Struts users:
> >>>
> >>> I'm wondering if it is possible to pass a parameter inside a s:submit
> >>> tag.
> >>>
> >>> I'm working with the following form (this is just a sketch) on a webpage,
> >>> in
> >>> which I collect some user data and display a list of elements (let's say
> >>> books):
> >>>
> >>> ___________ ____________
> >>> Name:|___________| Surname: |____________|
> >>>
> >>>
> >>> List of Books:
> >>>
> >>> Title
> >>> Author Details
> >>>
> >>> --------------------------------------------------------------------------------------------------------------------------------------------
> >>> XYZ ABC
> >>> <s:submit action="bookDetails" param="bookId">
> >>>
> >>>
> >>> ...
> >>>
> >>> Note: it has to be a submit because if the user enters a name or surname,
> >>> I
> >>> want it to be displayed when the users comes back from the book details
> >>> page!
> >>>
> >>> I dont know if this is possible with Struts 2
> >>>
> >>> Thanks in advance
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> 
> -- 
> Sent from my mobile device
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
 		 	   		  
_________________________________________________________________
Send us your Hotmail stories and be featured in our newsletter
http://clk.atdmt.com/UKM/go/195013117/direct/01/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message