UEP-弹窗

一、showModalDialog一个弹窗相应的写法:主要传值
Jsp
    <hy:gridbutton width="100" title="授权信息" editortitle="授权信息" οnclick="userRightShow()" />
JS    
    function userRightShow(cell) {
        var code = ajaxgrid.getRecord(cell.rowIndex).get("serviceCode");
        $.showModalDialog(
            $$pageContextPath+ "uepI/userRightShow.do?serviceCode=" + code, "服务权限查看", null,null, 500, 400, 0);
    }

$.showModalDialog(

url, title, callback, callbackparam, width, height, choosebutton, showx, showy) (此方法为常用方法)

 

url:弹出窗口的url

title:标题

callback:回调方法

callbackparam:回调方法的参数

width:宽度

height:高度

choosebutton: 设置值为0:没有按钮;设置值为1:显示确定按钮;设置值为2:显示取消按钮;设置值为3:显示确定、取消按钮,

showx:显示位置left

showy:显示位置top

弹出一个模式窗口,可设置窗口的标题、大小和显示内容的url,以及回调方法;

窗口若有返回值,在弹出窗口中方法returnValue中返回返回值,在回调方法中接收返回值即可;

Callback(returnValue, argument,isCancel)

回调函数可以有三个参数:

returnValue:为返回值

Argument:为初始带入的回调函数的参数

isCancel:当前操作是否为取消操作,isCancel ==0时,表示是点击取消或点击弹出窗上关闭按钮关闭弹出窗

    
    
Action
    private String serviceCode;
    public void retrieve() {
        this.dataWrap.setDataList(this.userRightShowService.retrieve(this.serviceCode, getQueryParam("dataWrap")));

        this.responseData.setParameter("serviceCode", this.serviceCode);
        this.responseData.setAjaxDataWrap("dataWrap", this.dataWrap);
    }
    protected void initTreat() {    
        //是否默认调用retrieve方法  true为默认使用  false默认不使用
        this.retrieveAfterInit = true;
    }
    public String getServiceCode() {
        return this.serviceCode;
    }
    public void setServiceCode(String serviceCode) {
        this.serviceCode = serviceCode;
    }

ServiceIpml
    public List<UserRightView> retrieve(String serviceCode, QueryParamList params2) {
        QueryParamList params = new QueryParamList();
        String jpql = "select new com.haiyisoft.vo.integration.UserRightView("
                + "r.serviceCode,r.loginCode,u.loginSystem) "
                + "from IntegrationUserRight r,IntegrationUserLogin u "
                + "where r.serviceCode=:serviceCode and u.loginCode=r.loginCode";
        params.addParam("serviceCode", serviceCode);
        List list = JPAUtil.find(jpql, params);
        
另一个JSP
    <title>服务权限查看</title>
    <%String code = request.getParameter("serviceCode"); %>
    <html>
    <body>
        <hy:view>
            <s:form action="userRightShow">
                <hy:layoutTable>
                    <hy:layoutArea>
                        <hy:ajaxgrid id="extgrid" name="dataWrap" width="100%" showpager="false"
                            readonly="true" showquerybar="true" height="100%" 
                            queryfunc="query()" >
                            <hy:gridlineno></hy:gridlineno>
                            <hy:gridfield name="loginCode" title="用户" width="200"></hy:gridfield>
                            <hy:gridfield name="loginSystem" title="登录系统" width="200"></hy:gridfield>
                        </hy:ajaxgrid>
                    </hy:layoutArea>
                </hy:layoutTable>
                <input type="hidden" name="serviceCode" id="serviceCode" upload="true"/>
            </s:form>
        </hy:view>
    </body>
    <script>
    $("#serviceCode").val("<%=code%>");
    </script>
    </html>

$.alert

title:标题

msg:提示信息

func:方法

width:宽度

height:高度

弹出模式窗口,提示用户信息

$.confirm

title:标题

msg:提示信息

Fun1:方法1

Fun2:方法2

width:宽度

height:高度

buttonTiltle:自定义按钮显示值(默认是”确定”、”取消”)

提示用户进行选择

$.confirm("提示信息","您是否决定执行此操作?",function(){alert("您选择了确定!")},function(){alert("您选择了取消!")},null,null,{yes:"",no:""});

 

 

转载于:https://www.cnblogs.com/kkdf/p/8108993.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值