jsf页面传参数到后台

<af:button text="修改" id="b3" useWindow="true" windowEmbedStyle="inlineDocument" windowWidth="450" windowHeight="420"
                     windowModalityType="applicationModal" action="#{xysfpBean.getAction}" returnListener="#{xysfpBean.returnEvent}"
                     actionListener="#{xysfpBean.actionSetParam}">
            <af:setPropertyListener from="update" to="#{pageFlowScope.cz}" type="action"/>
          </af:button>
          <af:button text="删除" id="b4" action="#{xysfpBean.getAction}" useWindow="true" windowEmbedStyle="inlineDocument"
                     windowModalityType="applicationModal" returnListener="#{xysfpBean.returnEvent}"
                     actionListener="#{xysfpBean.actionSetParam}" >
          <af:setPropertyListener from="delete" to="#{pageFlowScope.cz}" type="action"/>
          </af:button>

 

    /**
     *对选择记录进行可操作性判断
     * @param actionEvent
     */
    public void actionSetParam(ActionEvent actionEvent) {
        if (JSFUtils.resolveExpression("#{pageFlowScope.cz}") == null) { //操作判断
            return;
        }
        DCIteratorBinding dcIt = ADFUtils.findIterator("JyglJyxysfpView1Iterator");
        ViewObject xysfpImpl = dcIt.getViewObject();
        Row[] rows = xysfpImpl.getFilteredRows("IsChecked", true);
        int length = rows.length;
        String cz = JSFUtils.resolveExpression("#{pageFlowScope.cz}").toString();
        if (length == 0) {
            JSFUtils.addFacesErrorMessage("请选择记录");
            return;
        } else if (cz.equals("update") && length > 1) {
            JSFUtils.addFacesErrorMessage("修改时每次只能选择一条记录");
            return;
        } else if (cz.equals("delete")) { //删除
            this.action = "delete";
            return;
        } else {
            this.action = "update";
            xysfpImpl.setCurrentRow(rows[0]);
            return;
        }

    }

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值