This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Do you want to make an AJAX request or post back the page when the combo box's value is changed?? Both can be achieved easily with the onchange event of the s:select tag. Try to find a simple tutorial on google...
I'm still not sure whether you want to post back your page or not. If you want to use AJAX to do this, its a completely different thing, if you want to post back the page, its a completely different thing. Basically what exactly do you want to do?? I'll give you two scenarios
1. I have a site which is customized as per regions (like Nokia's site). I have a combo box of region on my site. On the basis of the region selected by the user, I want to send the user to a specific page. I'll post back the page in this case.
2. I have a site which sells products. I have a combo box for countries for the shipping address. On the basis of the country selected by the user, I want to show the total shipping cost of the product. Since in this case all that I want is just a simple calculation, I would use AJAX and not post back the page.
So what exactly do you want?? Your question is too ambiguous if you ask me. Its very tough to help if the goal is not clear...
Joined: Nov 25, 2009
I want actually the first scenario how can i achieve this
That's very simple to do. Suppose on the change of the combo box, you want to submit to a URL like change.action and send the combo box value as a request parameter like comboVal, then you can do this on the onclick event of the combo box
kiran chirravuru wrote:hello ankit can you give me your mobile number
And why would you want that for?? If you have any questions, you can ask it here
Joined: Nov 25, 2009
Here is the detailed scenario of my problem
I using struts 2.0 for my web application development . I have two methods in my action class .
From my jsp i want to trigger particular action method in the action class on combo change and different action method in the same
action class when my form is submitted and then i again i want to come back again to same jsp page.
But in the struts-config.xml in the action mapping we can define only one action class and one action method
at a time . So how can i achieve this scenario.