aspose file tools*
The moose likes Struts and the fly likes more once how can we submit JSP values to Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "more once how can we submit JSP values to Action" Watch "more once how can we submit JSP values to Action" New topic
Author

more once how can we submit JSP values to Action

sudhakar ananth
Ranch Hand

Joined: Feb 02, 2007
Posts: 68
Hello friends

1ST PROBLEM:

i have a dropdown list "Countries" if i select any of one then the next dropdown list should get values " States" and then when i select one of the 'state' then next dropdown list should get the values of "Cities" in it.


hope you all understood my problem

Country : "DROPDOWN LIST"
state : "STATES"
cities : "CITIES"

so what i did is
<html:select parameter="country" onChange="javascript to submit the form">
is this correct method
and similary when i submit this values i should get the next dropdown list populate with STATES values


So thing is how can i do it pls

i need the javascript code and as well as explanation

............................................................................

2ND PROBLEM:

Also i need to can we get values from "VALUEBEANS" which is set in arraylist like

let the valuebean has variable 'country' and i got values into this variable
in while(rs.next())
{
..
.....
and added to the arraylist arraylist.add(thebeanname);
}
then in ACTIONCLASS i am doing this

request.setAttribute("alist",arraylist);

So question lies in
where i have to keep what in
<html:select parameter"???"
<html ptionCollection parameter="???" or ???>
Kaustabh Singha Roy
Ranch Hand

Joined: Oct 04, 2005
Posts: 43
The first problem you mentioned is the typical case for which the "Ajax" technology is used. With this technology you can send requests to server, get the response data, and show the result in the web page. But without refreshing the page. This no doubt is done with javascript. The code for this is not going to be very trivial. I suggest you to Google for "Rico Ajax", that is easy to use. Try that and I hope you will get success.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This problem is generally referred to as "dependent dropdowns" or "dependent selects" . It has been discussed recently in this forum in this thread. You can also get a lot more information on it on the web by Googling one of the above topics.


Merrill
Consultant, Sima Solutions
sudhakar ananth
Ranch Hand

Joined: Feb 02, 2007
Posts: 68
Thank you very much.

What about my 2nd problem

have any gud solution
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
sudhakar,

I'm afraid I can't make any sense of what you are trying to say in your second problem. I would need to have you state the problem more clearly in order to help you with it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: more once how can we submit JSP values to Action
 
Similar Threads
Populating the Drop-down Box using Ajax
2 Drop Down JSF: AJAX: hx:ajaxRefreshRequest
Passing a Form Parameter
html:select and html:options or html:optionsCollection
html:select button in struts??