callback function in dojo.event.connect is not executing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

callback function in dojo.event.connect is not executing

');
                                               
        }

executeDOJO function is defined in some other common.js file as

function executeDOJO(urlpath,methodVal,mimeTypeVal,formName,errorMsg,callBackFunName){
        if(formName.trim() != ""){
                //formNodeVar = "document.getElementById(\" "+formName+" \")";
                formNodeVar = "document.getElementById(\""+formName+"\");";
                //alert(formNodeVar);
        }
        var errorAlertVal = "";
        if(errorMsg.trim() != ""){
                errorAlertVal = "function(type, data, evt) {"+
                                        "              jAlert(\" "+errorMsg+" \");"+
                                        "       } ,";
        }
        var bindArgs = {      
        url: urlpath,
        method: methodVal,
        error: errorAlertVal,
  cacheContent: false,
        mimetype: mimeTypeVal,
        formNode :  formNodeVar= (formName.trim() != "")?document.getElementById(formName):""      
    };
    var req = dojo.io.bind(bindArgs);
    dojo.event.connect(req, "load", this, callBackFunName);
}

My problem is createFieldsTab function is not executed as it has alert statement. this alert is not getting executed.
Please help me in this

I have put struts dojo plugin jar , json jar file in the class path.

I have put the debugger in the action "interactiveSeedingSearchResults" specified in struts.xml file.

While debugging the application, the control is going in the specified action and setting the parameters in JSON object. I have created an out object in the action method as follows and set the values:

jsonObject.put("seedingResults", seedingResultStringBuffer);
getServletResponse().setContentType("text/x-json;charset=utf-8");
PrintWriter out = getServletResponse().getWriter();
out.println(seedingResultStringBuffer);

Now, every thing is executed except the createFieldsTab callback function. In this function, I have taken the data from the data parameter and setting it to the parameters in the jsp.
callback function passed in dojo.event.connect function is not executing.

Please help me i this. I will be gratefull to you all.

Thanks and Regards
Neeraj
nk0086396
This post has NOT been accepted by the mailing list yet.
Hi All,

I have a JS file. It contains 2 methods as follows.

function selectForSeeding(batchInputId) {
       
        var bInputId = batchInputId.value;
        urlPath = "interactiveSeedingSearchResults.action?batchInputId="+bInputId;
        var errorMessage = "Problem in fetching data";
        executeDOJO(urlPath,"post","text/json","interactSeedRecordForm",errorMessage,"createFieldsTab");

}

function createFieldsTab(type, data, evt)
        {
                alert("Inside createFieldsTab");
                var seedingResults = data.seedingResults;
                var seedingResultsArray = seedingResults.split("~");
                var table = document.getElementById("batchdetail");
                var tbody = document.createElement('
Reply | Threaded
Open this post in threaded view
|

Re: callback function in dojo.event.connect is not executing

nk0086396
This post has NOT been accepted by the mailing list yet.
There is some editing in my post:

jsonObject.put("seedingResults", seedingResultStringBuffer);
getServletResponse().setContentType("text/x-json;charset=utf-8");
PrintWriter out = getServletResponse().getWriter();
out.println(jsonObject.toString());

There should be jsonObject.toString() instead of seedingResultStringBuffer.

Thanks and Regards
Neeraj