Jomar Lorentzen | Konsulent Bouvet ASA Sandakerveien 24C D11 Postboks 4430 Nydalen N-0403 Oslo Tlf. +47 23 40 60 00 | Faks: +47 23 40 60 01 | Mob: +47 41 63 97 09 http://www.bouvet.no | [EMAIL PROTECTED]
-----Opprinnelig melding----- Fra: Cosmin Marginean [mailto:[EMAIL PROTECTED] Sendt: ti 23.09.2008 10:43 Til: Stripes Users List Emne: Re: [Stripes-users] Sending event name Thanks for all of this. Will the Stripes book contain topics like this? (is there some sort of preview available) thank u all very much. that was so helpful. --- On Mon, 9/22/08, Tim Fennell <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> wrote: From: Tim Fennell <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> Subject: Re: [Stripes-users] Sending event name To: "Stripes Users List" <[email protected]> <mailto:[email protected]> Date: Monday, September 22, 2008, 5:34 PM It's really quite simple. What happens during a regular form submission is that the browser includes a parameter based on the button that was clicked. So if you have a button that looks like this in HTML: <input name="btnI" type="submit" value="I'm Feeling Lucky"/> then when you click on it the browser will add the following to the set of parameters posted: btnI=I'm Feeling Lucky Since Stripes knows ahead of time the set of events it can expect (based on method names and @HandlesEvent annotations) it pokes into the request and looks for any request parameters with a name that matches one of the event names it knows about. When it finds one it considers it a match and runs that event. So to simulate it using a link you just add a parameter with the name == eventName - the value doesn't matter. However, you shouldn't have to concern yourself with this as you can just do: <stripes:link beanclass="foo.bar" event="myEvent"/> -t On Sep 22, 2008, at 8:19 PM, farouk alhassan wrote: I think a literal explanation on how stripes is able to determine which button has generated the event will come in handy. this is because a lot of the times, i get into the situation where the action i am expecting will have to come from a link, not a button on a form. But i don't know how to make a link behave like a form post with the action name in the right place for stripes to pick up. I have had to resort to passing in a parameter and letting the default handler handle the event and using the parameter to tell which method to call. Cheers --- On Mon, 9/22/08, Freddy Daoud <[EMAIL PROTECTED]> wrote: From: Freddy Daoud <[EMAIL PROTECTED]> Subject: Re: [Stripes-users] Sending event name To: "Stripes Users List" <[email protected]> Date: Monday, September 22, 2008, 7:37 AM Hi Cosmin, A safer, more explicit, less 'hacky' way to do it is to use a hidden input whose name is '_eventName' and value is the name of your event, as in <s:hidden name="_eventName" value="execute"/> This would call public Resolution execute() on your action bean. Cheers, Freddy http://www.stripesbook.com On Mon, 22 Sep 2008 17:22:56 +0300, "Cosmin Marginean" <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> said: > Hello everyone, > > Again, I am running in a "best-practice" issue. I am trying to submit a > form to an action but not to it's default handler. For this, I saw that > having a submit button with the name of the event to be handled will > submit to that event handler. > > However, I am not using a submit button (UI issues) and I need to submit > to this non-default handler. As I saw, I can use a hidden input whose > name is the name of the event (same as in the case of the submit button > input). This seems to work (at a first glance at least) but I was > wondering if this can be avoided since it seems pretty "hacky" to me, to > be honest. > > Thanks, > Cosmin Marginean > > -- > cosminaru.ro -- [EMAIL PROTECTED] ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users ________________________________ ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ________________________________ _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users Cosmin Marginean -- cosminaru.ro
<<winmail.dat>>
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
