gazdzid
asked on
Request for Ajax - Double Combo Box in JAVA
Hello,
I was hoping that someone could provide me with an Ajax example for a double combo dropdown box that is in JAVA/jsp. I seem to find examples written in asp but Ibut have difficulties finding java/jsp. The example that I am looking for would accomplish the following:
Based on a selection within a dropdown field, a second select field will be populated.
Please provide an example that has the html code, javascript code, and the java or jsp code.
Thanks in advance for your assistance!!
I was hoping that someone could provide me with an Ajax example for a double combo dropdown box that is in JAVA/jsp. I seem to find examples written in asp but Ibut have difficulties finding java/jsp. The example that I am looking for would accomplish the following:
Based on a selection within a dropdown field, a second select field will be populated.
Please provide an example that has the html code, javascript code, and the java or jsp code.
Thanks in advance for your assistance!!
check this link.
http://www.mredkj.com/tutorials/tutorial003.html
http://www.mredkj.com/tutorials/tutorial003.html
ASKER
amitkathpal123:and amitkathpal123:,
Let me clarify, it is a dynamic dropdown, my thought is I should be able to pass in a field value and NEXT dropdown name. The server would return values the values for the NEXT dropdown.
I found something that I thought was close however it is written in asp, which can be found below but I would like the third page (within link) to be jsp.
http://www.developer.com/services/article.php/10928_3575081_1/Creating-a-Double-Combo-Linked-List-with-Ajax.htm
Let me clarify, it is a dynamic dropdown, my thought is I should be able to pass in a field value and NEXT dropdown name. The server would return values the values for the NEXT dropdown.
I found something that I thought was close however it is written in asp, which can be found below but I would like the third page (within link) to be jsp.
http://www.developer.com/services/article.php/10928_3575081_1/Creating-a-Double-Combo-Linked-List-with-Ajax.htm
Check the given code and go through above link for java method:
http://www.hiteshagrawal.c om/ajax/aj ax-program ming-with- jsp-and-se rvlets
http://www.hiteshagrawal.c
<script>
function populateValuesInSecondDropDown() {
var obj = document.getElementById('dropDownList1');
var val = obj.options[obj.selectedIndex].value;
// Ajax Call Here. Java Class method to be called for getting // response 'getListForDropDown'
// and 'showDropDownList' is the javascript call back method // which will be called automatically after response came back
var req = AJAXHttpRequest();
req.onreadystatechange = getReadyStateHandler(req, showDropDownList);
var timeStamp = new Date();
var url = 'getListForDropDown?param='+val;
req.open("get", url, true);
req.send(null);
}
function showDropDownList(response) {
// Display here all values(value will be in response) in drop //down
}
</script>
<select name="dropDownList1" onchange="populateValuesInSecondDropDown()">
<option>Select Something</option>
<option>op1</option>
<option>op2</option>
<option>op3</option>
</select>
ASKER
You wrote
// Ajax Call Here. Java Class method to be called for getting // response 'getListForDropDown'
// and 'showDropDownList' is the javascript call back method // which will be called automatically after response came back
Can you tell me the sever code if you look at page 3 it is in asp. I am looking for the jsp equivelant.
// Ajax Call Here. Java Class method to be called for getting // response 'getListForDropDown'
// and 'showDropDownList' is the javascript call back method // which will be called automatically after response came back
Can you tell me the sever code if you look at page 3 it is in asp. I am looking for the jsp equivelant.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I would like to check the suggestion provided. If possible please be patient and I will reply or award points.
ASKER
I wiil look at responce, sorry for the delay.
ASKER
will look at response
ASKER
I did get closer to my solution new question:
https://www.experts-exchange.com/questions/25013205/Ajaxx-question-'null'-is-null-or-not-an-object.html
https://www.experts-exchange.com/questions/25013205/Ajaxx-question-'null'-is-null-or-not-an-object.html
In this code, on change of value in first drop down, it automatically changes value in the second drop down.
Open in new window