常用方法

1.ADFUtils.findIterator

DCIteratorBinding dc = ADFUtils.findIterator("LocationsView1Iterator");

2.getViewObject

ViewObjectImpl vo = (ViewObjectImpl)dc.getViewObject();

3.getApplicationModule

ApplicationModule am = vo.getApplicationModule();

4.当前行

Row row = vo.getCurrentRow();
Row row = ADFUtils.getRow(richTable);

5.当前行的主键

ADFUtils.getOldKey(richTable());
ADFUtils.findIterator("LocationsView1Iterator").getCurrentRowKeyString();

6.多选行

List<Row> selectRows = ADFUtils.getTableSelectedRows(richTable);

7.获得所有行

RowSetIterator rsi = ADFUtils.findIterator("XsxxglXszcVo1Iterator").getViewObject().createRowSetIterator(null);
while (rsi.hasNext()) {
    Row row = rsi.next();
    row.setAttribute("Fdyqr", ZT_ONE); 
}
xsjbxxVo.setRangeSize(-1);
Row[] allRowsInRange = xsjbxxVo.getAllRowsInRange();

8.下拉列表多选

List njList =ADFUtils.getSelectListValueMany("XtglNjLov1", "Dm"); //拿到年级多选值

9.下拉列表单选。ADFUtils.getSelectListValueOne("ZcztLov1", "ZcztId");

<af:selectOneChoice value="#{bindings.ZcztLov1.inputValue}"
                  label="辅导员注册状态"
                  required="#{bindings.ZcztLov1.hints.mandatory}"
                  shortDesc="#{bindings.ZcztLov1.hints.tooltip}"
                  id="soc4">
<f:selectItems value="#{bindings.ZcztLov1.items}" id="si4"/>
</af:selectOneChoice>

10.获取inputText的值。ADFUtils.getBoundAttributeValue

BigDecimal ysje = (BigDecimal)ADFUtils.getBoundAttributeValue("Ysje");

11.根据一个绑定表达式返回其匹配字符串。

ADFContext.getCurrent().getPageFlowScope().get("xnxqOp");
ADFContext.getCurrent().getPageFlowScope().put("xnxqOp","addData");

JSFUtils.resolveExpressionAsString("#{pageFlowScope.sfEdit}"); 
JSFUtils.setExpressionValue("#{pageFlowScope.sfEdit}", "false");

12.页面绑定(发布成接口的)方法并调用。

OperationBinding op = ADFUtils.findOperation("query");
Map map = op.getParamsMap();//给方法传入参数
map.put("xn", xn);
map.put("xq", xq);
map.put("dw", dwStr); //单位(学院)
op.execute();

获取返回值

String msg = (String)op.getResult();

13.VoLink级联删除,在主表Row Class(JcglJcpdzbViewRowImpl)里重写remove方法。

    @Override
    public void remove() {
        RowIterator it = (RowIterator) getAttributeInternal(JCGLJCPDMXVIEW);
        it.reset();
        while (it.hasNext()) {
            it.next().remove();
        }
        super.remove();
    }

14.VO绑定变量默认值(如学年学期)

    /**
     * 获取当前学年学期
     * 1:当前学年学期,2:开课学年学期,3:排课学年学期
     * 4:选课学年学期,5:考试学年学期,6:注册学年学期
     */
    public Map getXnxqByType() {
        try {
            JcglServiceAMImpl am = (JcglServiceAMImpl)this.getApplicationModule();
            XtglXnxqszbViewImpl xnxqVo = am.getXtglXnxqszbView1();
            return xnxqVo.getXnxqByType(1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

v_xn

if(null!=adf.object.viewObject.getXnxqByType()){return adf.object.viewObject.getXnxqByType().get("xndm");};

转载于:https://my.oschina.net/u/3646781/blog/1576465

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值