Refresh DIV using ajax or jsf

Hi
I have a tree view in one DIV. I have DataTable in another DIV. If i add a row in the Data Table DIV. I need to show the changes in the Tree View. Its like file explorer in windows. Does anyone having a snippet of code using backing bean? Data retrieved using Hibernate. Ajax or jsf code are fine.
Thanks in advance.

Ed Burn's Dynamic Faces project does this very easily also using an AjaxZone tag or using some custom JavaScript. I have a blog entry that describes a solution for what you're trying to do:
http://blogs.sun.com/paulsen/entry/jsftemplating_dynamicfaces_easy_ajax
You can do this without JSFTemplating w/ Ed's project also w/o too much configuration effort.
Good luck!
Ken Paulsen
https://jsftemplating.dev.java.net

Similar Messages

  • Can I use Ajax with jsf

    Hi All,
    Is JSF 1.1 supports AJAX or not???
    Please tell me..

    JSF RI 1.1 = Java Server Faces Reference Implementation 1.1.
    It is the Sun reference implementation of JSF. There are also 3rd party implementations of JSF available, like MyFaces, Tomahawk, IceFaces, ADF, etcetera.
    If you aren't limited to JSF RI version 1.1, I recommend you to use version 1.2. It provides more features and benefits.
    Here are some links:
    https://javaserverfaces.dev.java.net
    http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/
    http://jsftutorials.net
    http://java.sun.com/javaee/5/docs/tutorial/doc/ (starting at chapter 9)
    http://jboss.org/projects/jbossAjax4jsf (most widely used AJAX library for JSF)

  • Best Practices of using AJAX with JSF : BluePrints or  Ajax4Jsf ?

    am a newbie to AJAX4JSF . I think it provides Rapid Application Development (RAD) just by using tags like a4j: without the need to develop complex JSF Custom Components as shown in BluePrints Catalog
    https://bpcatalog.dev.java.net/ajax/jsf-ajax/
    I understand the purpose of developing JSF Custom components as Reusable for using with AJAX. But its complex and requires lot of coding i.e. PhaseListeners and Managed Beans. There should be easy way to do this especially our project needs RAD tool like AJAX4JSF.
    Any suggestions will be highly appreciated
    Regards
    Bansi

    Bansi, you are trying to compare orange-to-apple. Blue print catalog is a historical retrospection about what people thought about AJAXifying JSF in the past. Currently, the playground has been moved to the jsf-extension project. Look for DynaFaces there.

  • Uploading a file to server using ajax and struts

    My problem is i wrote a program to upload a file to the server using Ajax.
    Here iam used Struts and Ajax.
    The problem is when iam uploaded a file from my PC the file is uploading to the server in the upload folder located in the server my system.
    Iam using Tomcat server 5.0
    But when iam trying to access it through other system it is not doing so
    Giving an internal server error i,e 500.
    Iam putting the necessary documents for ur reference.
    Plz help me soon .
    My exact requirement is i have to upload a file to the upload folder located in the server.
    And i have to get the path of that file and display the file path exactly below the browse button from where iam uploaded a file.
    That should be done without page refresh and submit thats y iam used Ajax
    Any help would greatly appreciated
    Thanks and Regards
    Meerasaaheb.
    The action class is FilePathAction
    package actions;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.*;
    public class FilePathAction extends Action{
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    String contextPath1 = "";
    String uploadDirName="";
    String filepath="";
    System.out.println(contextPath1 );
    String inputfile = request.getParameter("filepath");
    uploadDirName = getServlet().getServletContext().getRealPath("/upload");
    File f=new File(inputfile);
    FileInputStream fis=null;
    FileOutputStream fo=null;
    File f1=new File(uploadDirName+"/"+f.getName());
    fis=new FileInputStream(f);
    fo=new FileOutputStream(f1);
    try
    byte buf[] = new byte[1024*8]; /* declare a 8kB buffer */
    int len = -1;
    while((len = fis.read(buf)) != -1)
    fo.write(buf, 0, len);
    catch(Exception e)
    e.printStackTrace();
    filepath=f1.getAbsolutePath();
    request.setAttribute("filepath", filepath);
    return mapping.findForward("filepath");
    the input jsp is
    filename.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <script type="text/javascript">
    alertflag = false;
    var xmlHttp;
    function startRequest()
    if(alertflag)
    alert("meera");
    xmlHttp=createXmlHttpRequest();
    var inputfile=document.getElementById("filepath").value;
    xmlHttp.open("POST","FilePathAction.do",true);
    xmlHttp.onreadystatechange=handleStateChange;
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send("filepath="+inputfile);
    function createXmlHttpRequest()
    //For IE
    if(window.ActiveXObject)
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    //otherthan IE
    else if(window.XMLHttpRequest)
    xmlHttp=new XMLHttpRequest();
    return xmlHttp;
    //Next is the function that sets up the communication with the server.
    //This function also registers the callback handler, which is handleStateChange. Next is the code for the handler.
    function handleStateChange()
    var message=" ";
    if(xmlHttp.readyState==4)
    if(alertflag)
    alert(xmlHttp.status);
    if(xmlHttp.status==200)
    if(alertflag)
    alert("here");
    document.getElementById("div1").style.visibility = "visible";
    var results=xmlHttp.responseText;
    document.getElementById('div1').innerHTML = results;
    else
    alert("Error loading page"+xmlHttp.status+":"+xmlHttp.statusText);
    </script></head><body><form name="thumbs" enctype="multipart/form-data" method="post" action="">
    <input type="file" name="filepath" id="filepath" onchange="startRequest();"/>
    </form>
    <div id="div1" style="visibility:hidden;">
    </div></body></html>
    The ajax response is catching in a dummy.jsp
    <%=(String)request.getAttribute("filepath")%>
    corresponding action mapping
    <action path="/FilePathAction" type="actions.FilePathAction">
    <forward name="filepath" path="/dummy.jsp"/>
    </action>
    So plz help me to upload a file to the server from any PC.
    Iam searched alot but didnt get any solution.

    Plz help me soon if it possible so
    Iam in great need.
    I have worked alot but not worked out.
    Any help greatly appreciated

  • Submit page item using AJAX

    Hi All,
    Thanks for any help in advance.
    I am trying to submit an item into the session by using AJAX iin version 4.1
    I have a application process which is an on demand: run this application process when requested by a page process.
    begin
      :P4_FISCAL_YEAR2 := :AJAX_4_FISCAL_YEAR2;
    end;then in the item :P4_FISCAL_YEAR2 have the html form element attributes set to:
    (also the page item is set to None(Default) on page action when value changed.
    onchange="selectChanged6(this)"and a page process
    <script type="text/javascript">
    function selectChanged6(filter)
    var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=SET_4_FISCAL_YEAR2',0);
    get.add('AJAX_4_FISCAL_YEAR2', filter.value);
    var ret = get.get();
    </script>The item doesnt seem to be submitting into the session and I cant figure out why, Thanks

    Marie,
    I think I have acomplished what you are looking for but if your goal is quick response time then this can fluctuate since there is 1 ajax call made to set your item value and another ajax call for every chart you want to refresh.
    This solution assumes the following:
    1. all reports are in the same language and in english.
    2. all reports are flash charts.
    here is a demo: http://apex.oracle.com/pls/apex/f?p=43401:23:0
    Go into your chart template and add the class refreshable_chart
    <div class="rounded-corner-region refreshable_chart" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
    ...Create the following dynamic action on your chart page:
    Name: refresh_chart
    Event: Change
    Selection Type: Item(s)
    Item(s): P4_FISCAL_YEAR2
    True actions:
    Sequence: 10
    Action: execute pl/sql code
    Code:
    NULL;
    {code}
    Page Items to Submit: P4_FISCAL_YEAR2
    Sequence: 20
    Action: Execute JavaScript code
    Affected Elements:
    -- Type: jQuery Selector
    -- jQuery Selector: .refreshable_chart
    Code:
    {code:javascript}
    this.affectedElements.each(function(){
      apex_RefreshFlashChart(&APP_PAGE_ID., this.id.substr(1), 'en');
    {code}
    Good Luck,
    Tyson Jouglet
    Edited by: Tyson Jouglet on Dec 14, 2011 10:33 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can i upload file using ajax post request and jsp

    Hi
    this is my code files
    addPhoto.jsp
    <html>
    <head>
    <title>Add Photo</title>
    <script>
    var optionNo = 0;
    var i=1;
    var val=0;
    var file = 0;
    var exten = new Array(".jpg",".jpeg",".gif");
    function addValues()
         for(var i=0;i<5;i++)
              optionNo += 1;
              oNewOption = new Option();
              oNewOption.text = optionNo;
              oNewOption.value = optionNo;
              addSelect.add(oNewOption);
    function addBoxes()
         var str = "";
         var j=0;
         val = document.getElementById('addSelect').value;
         for(j=1; j<= val; j++)
              str = str + '<font size=3>file:' + j + '</font>';
              str = str + '<input type="file" id=filepath'+ j +' name=file'+ j + ' onchange="uploadFile(hidden'+ j + '.value)"><div id="result'+ j +'"></div>
              str = str + '<input type="hidden" name="hidden' + j + '" value=' + j +'>';
         document.getElementById('addPhoto').innerHTML = str;
    function uploadFile(value)
    var str = "filepath" + value;
    file = value;
    var param = document.getElementById(str).value;
    var parameter = "filepath=" + param;
    alert(parameter.length);
    if(checkValidity(param))
    var url = "uploadFile.jsp";
    if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    req.open("POST", url, true);
    req.setRequestHeader("Content-type", "multipart/form-data");
    //req.setRequestHeader("Content-length", parameter.length);
    req.setRequestHeader("Connection", "close");
    req.onreadystatechange = callback;
    req.send(null);
         else
              document.getElementById("result" + file).innerHTML = "upload .jpeg,.jpg,.gif Files Only";
    function callback() {
    if (req.readyState == 4) {
    updatepage(req.responseText);
    function updatepage(str){
         document.getElementById("result" + file).innerHTML = str;
    function checkValidity(str)
         var i=0;
         var j=0;
         var str1 = str.substring(str.lastIndexOf("."),str.length);
         alert(str1);
         for(i=0;i<exten.length;i++)
         if(str1.search(exten) != -1)
              j++;
              break;
         if(j>0)
              return true;
         else
              return false;
    </script>
    </head>
    <body onload="addValues()">
    <h5>Add Photo(s)</h5>
    <select id="addSelect" name="addSelect" onchange="addBoxes()">
    <option id="select" selected>Select</option>
    </select>
    <div id="addPhoto"></div>
    </body>
    </html>
    uploadFile.jsp
    <%@page import="java.io.*"%>
    <%
    /*try
    String contentType = request.getContentType();
         System.out.println(request.getMethod());
         System.out.println("Content type is :: " +contentType); 
         if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
              DataInputStream in = new DataInputStream(request.getInputStream());
              DataInputStream in1 = in;
              int formDataLength = request.getContentLength();
    System.out.println(formDataLength);
              byte dataBytes[] = new byte[formDataLength];
              int byteRead = 0;
              int totalBytesRead = 0;
              while (totalBytesRead < formDataLength)
                   byteRead = in1.read(dataBytes, totalBytesRead, formDataLength);
                   totalBytesRead += byteRead;
              out.println("<br>totalBytesRead : " + totalBytesRead + " : formDataLength = " + formDataLength);
         } catch(Exception e) {
              e.printStackTrace();
         try
         String filePath = request.getParameter("filepath");
         System.out.println(filePath);
         File f= new File(filePath);
         String path = f.getName();
         String contentType = request.getContentType();
         System.out.println(contentType);
         //InputStream in = new FileInputStream(filePath);
         DataInputStream in = new DataInputStream(request.getInputStream());
         int formDataLength = request.getContentLength();
         System.out.println(formDataLength);
    byte[] buf = new byte[1024];
    OutputStream out1 = new FileOutputStream("c:/docs/" + path);
    int len;
    while ((len = in.read(buf)) > 0) {
    out1.write(buf, 0, len);
    in.close();
    out1.close();
         out.write("File Uploaded SucssesFully");
    catch(Exception e)
         e.printStackTrace();
         out.write("error while Writing File");
    %>
    the above code in request.getContentType() i am getting 0. I am not passing the content length. for the same application with out using Ajax i am
    getting the size of file... it is very very urgent for me.. pls help me out on this...
    Any one having the code on this pls mail me the code...
    my mail id ... [email protected]
    Regards
    Ashok Kumar

    Sure, you can upload a file, using a form input element of type file. You pick this up with a servlet, though you need a special request wrapper to sort out the multi-part request you get back that way (there's a suitable package on jakarta.apache.org/commons)
    The servlet decrypts the file and can pass the results to a JSP for display.
    Don't try to do the complicated stuff in a JSP, it all gets incredibly messy, and that's not what JSPs are for.

  • Error processing a page when using AJAX

    hi apex forum.
    I need your help with a problem that presents me with an application in apex 4.2.
    I have developed a html screen, in which I have created a table that contains a detailed items and on which the user can enter some values. these data that user enters, I calculate a total at the end of the page. To view the current total of the entries , the user presses a button that uses AJAX (to avoid having to refresh the whole page)  to calculate totals and at the same time, i call an AJAX process to add each record to an apex_collection , until here everything perfect.
    The problem is that when I want to save the information to pass it from apex_collection to the database (by pressing a button and make the official insert), I must first have to refresh the page, if not do it this way, Apex generate an Error Message.
    it's important to say that error does not apper, if before pressing the button, i first refresh the page.  Any suggestions??
    I think I should use some internally command to synchronize or update the page.... any suggestions are welcome.,
    thanks in advance,

    Soooo...
    What is the error you are seeing?
    Is the multi-row process still there? What exactly happens on submit (computations, validations, processes)?
    Have you tried to run with debug enabled and were you able to see where the error originates?

  • Using AJAX to call a method of controller.

    I am working with weblogic 10.2 .I need to call a method of the controller using Ajax (because i don't wan to refresh the whole page).
    I am new to Ajax.
    Can any one provide me the stub or prototype for calling a method of contoller from jsp using AJax.

    Another approach, if you would like to call a Pageflow action and then update only a portion of a portlet with the result, would be to use the Dynamic Content taglib.
    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/javadocjsp/commonui/dc/tld-summary.html
    Edited by: Brad Posner on Jan 12, 2009 10:42 AM

  • Cross browser issue using ajax report pull

    Hi,
    I have an application working using ajax report pull.
    Entire application is based on ajax and its currently released.
    Its performance is good. It works fine with mozilla but in ie,
    links and buttons are not working.
    my code is as follows:
    var container = document.getElementById("divlayer");
         container.innerHTML="";
         var l_Val = document.getElementById('P15_ID').value;
         var l_Val1 = document.getElementById('P15_REGION').value;
         var l_Val2 = document.getElementById('P15_COUNTRY').value;
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,null,10);
         get.add('P15_GSI_PARTY_ID',l_Val);
         get.add('P10_ID',l_Val);
         get.add('P10_REGION',l_Val1);
         get.add('P10_COUNTRY',l_Val2);
         get.add('P10_ROWS',l_Val3);
         get.add('P15_REGION',l_Val1);
         get.add('P15_COUNTRY',l_Val2);
         get.add('P15_ROWS',l_Val3);
         gReturn = get.get(null,'<htmldb:BOX_BODY>','</htmldb:BOX_BODY>');
         get = null;
    document.getElementById("divlayer").style.visibility='visible';
    document.getElementById("divlayer").style.display='block';
    var elem = document.createElement('div');
         elem.id='d1';
    elem.innerHTML=gReturn;
         container.appendChild(elem);
    The links with doSubmit is not submitting to the same page in ie.
    Please help me.
    Thanks,
    Niveditha

    Hello Niveditha,
    There're some differences in browsers... so yes it's possible that it doesn't work with the same code in another browser. The good news is that most of time there're workaround.
    When I look at your code, you could already change document.getElementById() by $x(), which is doing the same, but comes from the APEX framework.
    Do you have an idea where it fails in IE? Are you using the Developer Toolbar? Maybe that gives you more insights. You could also put some alert('hello 1'); in your code to see what's happening and how far it comes.
    If you put it on apex.oracle.com we can have a look into more detail.
    Dimitri
    -- http://dgielis.blogspot.com
    -- http://apex-evangelists.com

  • Load an external gallery  file into a host div via Ajax method?

    I was just wondering if anyone has been able to get a spry
    gallery to work when placed within an external html file and loaded
    into the host div of a page using Ajax method to load. It must work
    remotely (on the Internet).
    I've tried and mutilated enough sample files, that I'm
    continuing my work in Flash and don't have anything un-mutilated to
    post at this moment.
    If you have, great. Let me know. If you have a link somewhere
    it has been done correctly that I can look into and are willing to
    post the link, I'd be glad to see it working.
    thanx.

    I am not calling any scripts from an outside server. All of
    the external htm files I am pulling are located within the site
    root (or in a sub folder of).
    What I am trying to do is have two Spry gallery slideshows
    (very similar to the demo) coded on separate htm pages that are
    brought into divs of the index file (main file).
    I have a spry tabbed panels widget. The content for each of
    the "TabbedPanelsContent" divs are in external htm files. The
    external files that contain basic text, images, and links work
    beautifully. The files that have Spry Gallery slideshows in them do
    not display properly.
    The experimental files I've created are in major disarray
    because I've added other issues to test. When I can return to it
    and prepare a new troubleshooting file, I will post a link if I
    haven't resolved it. -- or the solution if I find it. Mainly I was
    wondering if anyone had created something similar so I could
    inspect the code to compare.
    Thank you for replying Cristian!

  • Error while using ajax in jsff

    Hi All,
    I am using JDev 11.1.2.0 to develop my ADF Page
    I want to use ajax in one of my jsff to us the activeOutputText component for autpmatic ppr
    I am using the following code :
    <f:ajax onevent="function(e) {}" event="PropertyChange" render="t1 t2 ot3 ot2">
    <af:activeOutputText value="#{TestBean.message}" id="aot1">
    <f:ajax/>
    </af:activeOutputText>
    </f:ajax>
    When I am running the page , I am getting the following error :
    Line # 4 <af:panelGroupLayout id="pgl2">
    Error: http://java.sun.com/jsf/core:ajax is not registered tag in the specified namesapace.
    Please suggest to resolve this issue

    hI,
    Thanks for the reply..
    I am getting this error message in the logs
    " Line # 4 <af:panelGroupLayout id="pgl2">
    Error: http://java.sun.com/jsf/core:ajax is not registered tag in the specified namesapace. "
    The begining of my jsff looks like this
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">

  • Tutorial on how to create an Ajax-enabled JSF component in Creator?

    Is there a tutorial on how to create (not use/import existing) an Ajax-enabled JSF component using Creator 2? I read somewhere that it was done during a presentation in 3 minutes! Now that I really want to see ;-
    thanks,
    -nikita

    As far as I remeber, Edwin Goei's examples are the
    closest thing to the info you are looking. He has an
    example component, but don't remember if they're
    AJAX enabled. Check it on
    http://wiki.java.net/bin/view/Javatools/CustomCompone
    tLibraries.
    Best regards
    Antonio.Thanks for the plug. I've been meaning to update that article. Writing an AJAX component is similar to writing other kinds of components but the developer uses AJAX techniques. The latest version of the popup calendar which is checked into the bpcatalog project of java.net uses Dojo which also has some support for AJAX. I haven't yet had time to update the article yet, unfortunately.
    -Edwin
    http://blogs.sun.com/edwingo/

  • Pagination using AJAX

    i need to implement pagination in my jsp page.
    is it possible to create a table in the page and upon clicking the next page,retrieve only the sufficient data from the server using AJAX?
    my idea is to retrive data in xml format from the database and use AJAX to display it in the table.will it be possible?

    I think you can do it only using JSF DataTable instead Ajax.

  • Refresh DIV area contents

    I have DIV area on my page which contains php code <? echo
    rand();?> this shows random number in DIV area, now i have to
    refresh this DIV area so that on click only this DIV area refreshes
    and new random number appears. after this i will update this DIV
    section using timeout which will automatically refresh DIV area
    after specific interval of time.
    I am ok with loading another file in div area, but how can i
    get the same functionality with some code or content in the div
    area . Please help me in this regard. Thanks

    1, make a single page that echos the echo rand.
    2, use a function that pulls th php file in to the div
    container, u using Spry.Utils.updateContent
    1, u can probly do that your self,
    2, i can give u a little example.
    Include the following in the mainpage's header:
    SpryData.js
    SpryDOMUtils.js
    Also include this script in your header:
    <script type="text/javascript">
    Spry.Utils.addLoadListener(function(){
    updateDIV
    function updateDIV(){
    //DIVIDNAME = the id of the element where u want the rand to
    be loaded in also u can change rand.php to what ever file name u
    want to be loaded
    //change settimeout to how many sec u want the div to be
    refreshed
    Spry.Utils.updateContent('DIVIDNAME', 'rand.php');
    setTimeout('updateDIV();',10000);
    </script>
    This will do what u described in your post.

  • Problem if i use ajax in struts

    hi,
    i am working on struts, now i got one problem if i use ajax in jsp.
    In my jsp page i have two dropdown lists, according to the first dropdown value second dropdown result will getting from the database by calling an action class.
    but my requirement is for getting the second dropdown result page should not be refresh for this i am using ajax.
    in ajax how can we call one action class what should we return in actionmapping.
    If any one already written some code for this please send it to me.
    please can anyone help on this its very urgent for me.

    Hi
    First of all you have to write on fnRetrieveURL which will be responsible for getting the connection and XML communication.
                   function fnRetrieveURL(strURL, strFnProcessStateChange)
                        if(window.XMLHttpRequest)
                             varXMLrequest = new XMLHttpRequest();
                             varXMLrequest.onreadystatechange = eval(strFnProcessStateChange);
                             try
                                  varXMLrequest.open("POST",strURL,true);
                             catch(Exception)
                                  alert("Problem in Getting data ");
                             varXMLrequest.send(null);
                        else if(window.ActiveXObject)
                             varXMLrequest = new ActiveXObject("Microsoft.XMLHTTP");
                             if(varXMLrequest)
                                  varXMLrequest.onreadystatechange =eval(strFnProcessStateChange);
                                  varXMLrequest.open("POST",strURL,true);
                                  varXMLrequest.send();
                   }This method will be called in user written method in which request will be submitted to action class.
                   function fnGetAreaForRegion()
                        var iRegion = document.getElementById("region").value;
                        var strURL = "../getAreaForRegion.do"
                        strURL = strURL+"?methodName="+"getAreaForRegion";
                        strURL = strURL+"&controlName="+"area";
                        strURL = strURL+"&iRegion="+iRegion ;
                        fnRetrieveURL(strURL,"fnOnReturnFromRegion");
                   }Then there will be one on Return method i.e the method which will be called when the response will come back to JSP from fnGetAreaforRegion.
                   function fnOnReturnFromRegion()
                        if (varXMLrequest.readyState == 4)
                             if(varXMLrequest.status == 200)
                                  var strSubClassValue = varXMLrequest.responseText;
                                  if(strSubClassValue != '')
                                    var strArray = strSubClassValue.split(",");
                                       var iLength = strArray.length;
                                       var strName = new Array();
                                       var strID = new Array();
                                       var j=0;
                                       for(var i =0 ; i< iLength;i=i+2)
                                            strName[j] = strArray;
                                            j++;
                                       var k=0;
                                       for(var i =1 ; i< iLength;i=i+2)
                                            strID[k] = strArray[i];
                                            k++;
                                       var iNewLength = strID.length;
                                       var optnSelect = document.createElement("OPTION");
                                       optnSelect.text = 'Select';
                                       optnSelect.value = '';
                                       document.getElementById("area").options.add(optnSelect);
                                       for(var i =0 ; i< iNewLength;i++)
                                            var optn = document.createElement("OPTION");
                                            optn.text = strName[i];
                                            optn.value = parseInt(strID[i]);
                                            document.getElementById("area").options.add(optn);
    Rest modification in struts-config, you can do by urself. and also you have to write one action class which will take care of parameters and all business logic.
    Above code you can reuse by bit modification. Action class you have to write by your own.
    let me know if you still face any issues

Maybe you are looking for

  • Only balances in local crcy (no efect)

    Hi, I have a problem with an account that didn't have the ''Only balances in local crcy'' checkmark on in FS00. After I activated this checkmark, I am still able to see balances in other currencies and this is not normal. Do I have to make something

  • Mac Pro 2010

    Downgrade Mac OSx 10.6.4 (snow leopard) to Mac OSx 10.5.(8) (leopard. Does somebody know of it is posible. I have tried it but i have the 10.5.1 version that is to old.

  • Accessing U.S. itunes store abroad?

    Can I access the U.S. itunes store in Europe via my existing U.S. account? I.e., does it matter where I am if I'm using the same account I use in the U.S.? Can I access all the same content? Thanks

  • Blackberry Curve - Shuts Off & Restarts Itself

    I've had the BB Curve for almost a year now and I've noticed that recently it takes it upon itself to shut off and restart itself when I'm in the middle of a call..text..browsing my pics..or using any program such as email or Facebook. It did it a fe

  • Creating an Index HTML in Dreamweaver?

    I am new to Dreamweaver and was trying to up load my web to the server.  It seems most servers require an INDEX HTML as the opening p age.  However, dreamweaver does not create this.  I have afolder with the home page files in it.  How do I make thes