0

我的 oracle apex 应用程序javascripts的页面上有以下两个。HTML Header

<script type="text/javascript">
function createEventListeners3(pThis)
{

var mainRow = "f04_"+pThis.id.substr(pThis.id.indexOf('_')+1);
$("#" + mainRow).change(function(){
var that = this;
var vRow = "f06_"+pThis.id.substr(pThis.id.indexOf('_')+1);
$.post("wwv_flow.show", 
       {p_request      : "APPLICATION_PROCESS=GET_AMOUNT",
        p_flow_id      : $v("pFlowId"),
        p_flow_step_id : $v("pFlowStepId"),
        p_instance     : $v("pInstance"),
        x01            : $(this).val()
        },
        function(data){ 
            if ($("#" + vRow).val() == ''){
                $("#" + vRow).val(data);
            }
        },
        "text"
      );
});

}
</script>

javascriptautocomplete select event这里打电话给上面。

<script type="text/javascript">
function createEventListeners()
{

$(function(){
 /* Set autocomplete */
 $('input[name="f04"]').autocomplete({
  source:function(req,res){

   /* Parameters for jQuery ajax */
   var opt={
    url:"wwv_flow.show",
    dataType:"json",
    traditional:true,
    cache:false,
    type:"POST",
    data:{
     p_flow_id:$v("pFlowId"),
     p_flow_step_id:$v("pFlowStepId"),
     p_instance:$v("pInstance"),
     p_request:"APPLICATION_PROCESS=GET_DESCRIPTION",
     x01:req.term
    },
    success:function(jsonData){
     res(
      $.map(jsonData.row,function(jsonRow){
       return{
        label:jsonRow.RET,
        value:jsonRow.DIS
       };
      })
     );
    }
   };
   /* Call Ajax to get list */
   $.ajax(opt);
  },
  focus:function(event,ui){
   /* Prevent value change when list get focus */
//   return false;
event.preventDefault();
  },

  select: function (event, ui) {

    createEventListeners3(this.id);
}

 });
});

return;
}
</script>

但我得到了错误。

Uncaught TypeError: Cannot call method 'indexOf' of undefined

我怎么能解决这个问题?

4

1 回答 1

0

您已经可以将 id 而不是对象传递给 function createEventListeners3this使用而不是传递对象this.id

改变

createEventListeners3(this.id);

createEventListeners3(this);
于 2013-01-28T10:36:59.023 回答