Selection from form invokes an action
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   William_Blencowe
Posted On:   Friday, January 9, 2004 08:10 PM

Hello, I have a struts web app where I need the user to choose an entry from a select as part of a form. I would like to change pages just as if the user clicked on a link. I currently have the form in as html with a javascript function called from the 'onchange' event in the form. I can't figure out how to call the action? Typically I've used the html taglib with the link with the forwarding action, but this requires the user to hit the link with the mouse. The select box has some nice qualities on my page. Part of my mistake maybe combining Javascript and struts?? I know struts is server side, I was hoping to get some more dynamic client side... Looking for resources... thanks, bill    More>>

Hello,
I have a struts web app where I need the user to choose an entry from a select as part of a form. I would like to change pages just as if the user clicked on a link. I currently have the form in as html with a javascript function called from the 'onchange' event in the form. I can't figure out how to call the action? Typically I've used the html taglib with the link with the forwarding action, but this requires the user to hit the link with the mouse. The select box has some nice qualities on my page.

Part of my mistake maybe combining Javascript and struts??

I know struts is server side, I was hoping to get some more dynamic client side...

Looking for resources...

thanks, bill

   <<Less

Re: Selection from form invokes an action

Posted By:   Prasanna_Talakanti  
Posted On:   Saturday, January 10, 2004 08:20 AM

Hi William,

You can do this using a Dispatch action class, Every option value in your List box has method in (Dispatch Action), It will forward the request to the page you configure in strutsconfig




public TestAction extends DispatchAction
{
public ActionForward page1(etc)
{
mapping.findForward("success");
}
public ActionForward page2(etc)
{
mapping.findForward("success");
}

}

//jsp page




hope this helps
About | Sitemap | Contact