js代码2

页面onclick触发代码:
function selectVoice(obj)
{
//window.location.href="${request.contextPath}/callcenter/toAgentManagePhone.action";
//设置iframe弹出的窗体的iframeId
var url = "${request.contextPath}/callcenter/toAgentManagePhone.action";
listView = new DlgUtil().makePane(url,'<isap:label value="'选择座席电话号码'" />',"160px","100px","350px","400px",null);
listView.show();
var isvQueryResDeal = getQueryResDeal();
isvQueryResDeal.open(listView,getPhoneValue);
}
function getQueryResDeal()
{
/*对应各种资源的处理函数*/
var queryResDeal =
{
handleSubscible:null, //资源订购句柄
handleConnect:null, //关联事件句柄
subResName:null, //资源名
callBack:null,         //回调函数
    deal : function(message)
    {
        if (null != message && message.length > 0 && null != this.callBack)
        {
            this.callBack(message);
        }
        else if(null != this.callBack)
        {
        this.callBack();
        }
    },
    open: function(obj,obj1)
    {
    this.close();
    //动态获取资源名称,资源名称和wigetId相同
    this.subResName = getWidgetId();
    //指定回调函数
this.callBack = obj1;
    //订购资源
    this.handleSubscible = dojoSubscribe(this.subResName, queryResDeal, "deal");

    /*关联obj的关闭事件处理函数*/
    this.handleConnect = dojoConnect(obj, "onHide", null, function(event){
    widgetIdDec();
    queryResDeal.close();
    dojoStopEvent(event);
    });    
    },
    close: function()
    {
    //取消事件关联
    if (null != this.handleConnect)
    {
    dojoDisConnect(this.handleConnect);
    this.handleConnect = null;
    }
    //取消订购
    if (null != this.handleSubscible)
    {
    dojoUnSubscribe(this.subResName, queryResDeal, "deal");
    this.handleSubscible = null;
    }
    }
};

return queryResDeal;
}

你可能感兴趣的:(js)