經常使用方法

1.ADFUtils.findIteratoride

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

2.getViewObjectui

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

3.getApplicationModulethis

ApplicationModule am = vo.getApplicationModule();

4.當前行code

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

5.當前行的主鍵接口

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

6.多選行ip

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

7.得到全部行ci

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.下拉列表多選rem

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.getBoundAttributeValueget

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");};
相關文章
相關標籤/搜索