下拉赋默认值

 <af:selectOneChoice value="#{ZsfBean.yearSel}"  
                              label="#{bindings.NjLov1.label}"
                              required="true"
                              shortDesc="#{bindings.NjLov1.hints.tooltip}"
                              id="soc3">
            <f:selectItems value="#{bindings.NjLov1.items}" id="si3"/>
          </af:selectOneChoice>
    /**
     * 默认选择当前年级
     * */
    public void dialogFetchListener(PopupFetchEvent popupFetchEvent) {
        Calendar a = Calendar.getInstance();
        int year = a.get(Calendar.YEAR);
        yearSel = String.valueOf(year);
    }
    /**
     * 生成住宿费
     * @param dialogEvent
     */
    public void scybfListener(DialogEvent dialogEvent) {
        try {
            Row row =
                ADFUtils.findIterator("SfglZsfsfbzView1Iterator").getCurrentRow();
            String nf = this.getYearSel();
}

 ZsfBean.yearSel 主要是在MB中先定义这个年值yearSel

或者使用#{pageFlowScope.xx}  赋值

 <af:selectOneChoice value="#{pageFlowScope.xn}" autoSubmit="true"
                              label="#{bindings.XnLov1.label}" required="true"
                              shortDesc="#{bindings.XnLov1.hints.tooltip}"
                              id="soc1">
            <f:selectItems value="#{bindings.XnLov1.items}" id="si1"/>
          </af:selectOneChoice>

 String xndm = (String)JSFUtils.getElExpression("#{pageFlowScope.xn}");

--摘自 收费系统-学生学杂费-统计导出

猜你喜欢

转载自563432906.iteye.com/blog/2254452