La llamada jQuery Ajax devuelve xhr.status = 0 y thrownError = undefined

Hi I have read through all the related topic and tried most of the solutions but I still have the problem. I am using a ADF JSF page and have links against each row of a af:table. OnClick, I call a function and pass the selected value and set it as hidden. Then with jQuery, I call ajax and pass the hidden value. My ajax servlet gets called and I return a Json object. But the ajax throws undefined error and nothing happens. Here's my code

  $(document).ready(function(){                    
      $(".modal").click(function() {
         $.ajax({                             
             url : '/CCA/ajax',
             cache: false,
             data:{ 
                custnumvalue: '404', // hardcoding for now
                methodcallname: 'showVehicleDtls'},
             method: 'POST',
             dataType: 'json',
             contentType: "application/json; charset=utf-8",
             success : function(json) {
                if(!(json.Error == 'true')){
                   populateVehicles(json); 
                }else if(json.Error == 'true'){
                   alert(json.ErrMsgs);
                }
             },
             error:function (xhr, ajaxOptions, thrownError){
                alert(xhr.status);
                alert(thrownError);
             }                                
          });                            
      });      

    }); 
// this function is called onClick()   
function setCustValue(cval){
   $("#myForm\\:hideOut").val(cval);
}

preguntado el 01 de febrero de 12 a las 04:02

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.