我的 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>
我javascript
从autocomplete 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
我怎么能解决这个问题?