anitha vasikarla

Greenhorn
+ Follow
since Apr 22, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by anitha vasikarla

Hi,

var ajaxRequest;
function makeAjaxRequest(url, callback)
{
if (window.XMLHttpRequest)
{
ajaxRequest = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
}

ajaxRequest.open("GET", url, true);
ajaxRequest.onreadystatechange = callback;
ajaxRequest.send(null);
}
//some code will come here.............................................1
.....
makeAjaxRequest("states/statex", updateCities);
makeAjaxRequest(".../states?country=UK" + country, updateStates);
makeAjaxRequest(".../cities?state=Scotland" + state, updateCities);
makeAjaxRequest(".../cities?state=England" + state, updateCities);
makeAjaxRequest(".../cities?state=Wales" + state, updateCities);
makeAjaxRequest(".../states?country=US" + country, updateStates);
makeAjaxRequest(".../cities?state=Newyork" + state, updateCities);
makeAjaxRequest(".../cities?state=California" + state, updateCities);
makeAjaxRequest(".../cities?state=Pennsylvania" + state, updateCities);
makeAjaxRequest(".../cities?state=Washington" + state, updateCities);
makeAjaxRequest(".../cities?state=Maryland" + state, updateCities);
makeAjaxRequest(".../states?country=INDIA" + country, updateStates);
makeAjaxRequest(".../cities?state=Andrapradesh" + state, updateCities);
makeAjaxRequest(".../cities?state=Kerala" + state, updateCities);
makeAjaxRequest(".../cities?state=Maharashtra" + state, updateCities);


..................................................................................2
function updateCities()
{
if (ajaxRequest.readyState == 4)........................................4
{
if (ajaxRequest.status == 200)...............................5
{
...

//some code will come here.................................3
}
else
{
alert("Cannot load data!");
}
}
}


I dont know AJAX so Iam asking each and every line clearly I mentioned my doubts with 1,2,3,4,5.
at 1,2,3 these places will you please tell me which code will come.and please explain 4 and 5 lines and what is the purpose of those lines.
Hi,
I am Anitha I have a task If I click one option box like country then corresponding states to appear,than I click states than next option box must display cities.please see this link you will get an idea http://www.bharatbloodbank.com/search.php How to do it in struts.based on this
You replied it is easy in AJAX but iam not perfect in AJAX but i wrote some code in Struts is it correct process or not will you provide correct process to me

import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public final class SearchAction extends Action
{
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)throws Exception

{
EmployeeSearch

if (templateList != null && !templateList.isEmpty())
{
templateLable = new ArrayList();
for (int i = 0; i < templateList.size(); i++)
{
List state=new arraylist();
state.add("Andrapradesh");
state.add("Kashmir");
state.add("Maharashtra");
state.add("Uttarapradesh");


Template lableValueset = (Template) templateList.get(i);
if (lableValueset != null)
{
LabelValueBean lvb = new LabelValueBean(lableValueset.getTemplateName(),
lableValueset.getTemplatePkey().toString());
templateLable.add(lvb);
}
}
request.getSession().setAttribute("TEMPLATE_LIST", templateLable);


In above code where can i add states,cities,countries please give me correct Idea.
14 years ago
Hi,

var ajaxRequest;
function makeAjaxRequest(url, callback)
{
if (window.XMLHttpRequest)
{
ajaxRequest = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
}

ajaxRequest.open("GET", url, true);
ajaxRequest.onreadystatechange = callback;
ajaxRequest.send(null);
}
//some code will come here
.....
makeAjaxRequest("states/statex", updateCities);
//here also
......
function updateCities()
{
if (ajaxRequest.readyState == 4)
{
if (ajaxRequest.status == 200)
{
...
// something here
//some code will come here
}
else
{
alert("Cannot load data!");
}
}
}


you have given this code but iam not perfect in AJAX where can I provide states,countries,cities.will you provide code based on this question.
Hi
I am Anitha I have a task If I click one option box like country then corresponding states to appear,than I click states than next option box must display cities.please see this link you will get an idea http://www.bharatbloodbank.com/search.php How to do it in Ajax will you provide code or if any examples are available will you give that site name.



Thanks & Regards,
Anitha
if (templateList != null && !templateList.isEmpty()) {
templateLable = new ArrayList();
for (int i = 0; i < templateList.size(); i++) {
Template lableValueset = (Template) templateList.get(i);
if (lableValueset != null) {
LabelValueBean lvb = new LabelValueBean(lableValueset.getTemplateName(),


In this code "LabelValueBean " used what is the use of that one,how it works.
14 years ago