日期:2014-05-18  浏览次数:20627 次

dwr返回函数不执行,怎么解决
用dwr执行插入,返回函数不执行。点击会执行了插入,就是不调用返回函数,代码如下

function insertWorkPlan(obj){
    if(button_onsubmit()){
     var trobj=j$(obj).parent().parent();
     var programName=j$(trobj).find("select[name=programName]").val();
     var workTime=j$(trobj).find(":input[name=workTime]").val();
     var workBreak=j$(trobj).find(":input[name=workBreak]").val();
     var workDiscretion=j$(trobj).find(":input[name=workDiscretion]").val();
     var finishDate=j$(trobj).find(":input[name=finishDate]").val();
     var finishStatue=j$(trobj).find("select[name=finishStatue]").val();
     var headPepole=j$(trobj).find(":input[name=headPepole]").val();
     var remark=j$(trobj).find(":input[name=remark]").val();
     var coordinationObject=j$(trobj).find(":input[name=coordinationObject]").val();
     var superviseTime=j$(trobj).find(":input[name=superviseTime]").val();
     var taskType=j$(trobj).find("select[name=taskType]").val();
     var myworkplan =programName+","+workTime+","+workBreak+","+workDiscretion+","+finishDate+","
     +finishStatue+","+headPepole+","+remark+","+coordinationObject+","+superviseTime+","+taskType;
     //DWREngine.setAsync(false);  
     WorkPlanProxy.insertWorkPlan(myworkplan,function(data){workBack(data,obj,myworkplan);});
     //DWREngine.setAsync(true);  
    }
  }
  function workBack(data,obj,myworkplan){
  alert(data+"===");
  var trobj=j$(obj).parent().parent();
  var datas=myworkplan.spilt(",");
  j$(trobj).empty();
  j$(trobj).html(
    '<td>'+datas[0]+'</td><td>'+datas[1]+'</td><td>'+datas[2]+'</td><td>'+
    datas[3]+'</td><td>'+datas[4]+'</td><td>'+datas[5]+'</td><td>'+datas[6]+'</td>'+
        '<td>'+datas[7]+'</td><td>'+datas[8]+'</td><td>'+datas[9]+'</td><td>'+datas[10]+'</td>'+
        '<td>'+ '<a href="#" onclick="updateWorkPlan(this)">修改</a>&nbsp;&nbsp;<a href="#" onclick="deleteWorkPlan(this)">删除</a>'+
        '</td>'
  );
  }



求高手解决,谢谢。

------解决方案--------------------
把这个function insertWorkPlan(obj)函数名改下  别和WorkPlanProxy.insertWorkPlan 一样!试下。。。。

------解决方案--------------------
1.先在dwr测试界面测试方法能否成功执行
2.如果可以执行,<convert converter="bean" > json自动转换成bean的 配置删除 ,再在dwr测试页面里<