锘??xml version="1.0" encoding="utf-8" standalone="yes"?>午夜在线电影亚洲一区,精品乱人伦一区二区三区,欧美日韩亚洲成人http://www.aygfsteel.com/Noah/category/54627.html<span style="font-family: 瀹嬩綋; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri" lang="ZH-CN">涓嶆槸緇忓吀鎴戜笉鍙?lt;/span>zh-cnWed, 26 Nov 2014 22:06:13 GMTWed, 26 Nov 2014 22:06:13 GMT60JSF瀛︿範鏃ュ織http://www.aygfsteel.com/Noah/articles/420611.html鐪奸暅铔?/dc:creator>鐪奸暅铔?/author>Wed, 26 Nov 2014 05:38:00 GMThttp://www.aygfsteel.com/Noah/articles/420611.htmlhttp://www.aygfsteel.com/Noah/comments/420611.htmlhttp://www.aygfsteel.com/Noah/articles/420611.html#Feedback0http://www.aygfsteel.com/Noah/comments/commentRss/420611.htmlhttp://www.aygfsteel.com/Noah/services/trackbacks/420611.html
@Named("bean1") // or @ManagedBean(name="bean1") or 涓嶆寚瀹氬悕瀛楋紝榛樿Bean鐨勫悕錛宻ampleBean
@SessionScoped
public class SampleBean {
    public int getLuckyNumber() {  }
    public void setLuckyNumber(int value) {  }
    public String login() {
    if () return "success"; else return "error";
    }
}
欏甸潰榪欐牱鍐欙紝鐩存帴璋冪浉搴旂殑鏂規硶
<h:commandButton value="press me" action="#{bean1.login}"/>
2.瓚呴摼鎺?br />
<h:link outcome="#{custVM.gotoDetail}" includeViewParams="true" target="_blank">
      <f:param name="scmNo" value="#{warr.project_no}"/>
      <f:param name="custNo" value="#{warr.cust_no}"/>  
      <f:param name="custName" value="#{warr.cust_name}"/>  
      <h:outputText value="#{warr.accrued_amt}">
           <f:convertNumber currencySymbol="$" type="currency" />
      </h:outputText>
</h:link>
鍦ㄧ洰鏍囬〉闈㈠啓涓嬮潰榪欎釜錛岃繖鏍峰氨鍙互浼犺繃鏉ヤ簡
<f:metadata>
     <f:viewParam name="scmNo" value="#{custVM.scmNo}" />
     <f:viewParam name="custNo" value="#{custVM.custNo}" />
     <f:viewParam name="custName" value="#{custVM.custName}" />
</f:metadata>
3.涓嬫媺鑿滃崟鍐欐硶錛?br />
private List<SelectItem> monthItems; //瀹冩湁鑷繁鐨凷electItem 綾伙紝鐢ㄦ潵瀛橀敭鍊煎銆?/span>
    
    @PostConstruct
    public void init() {
        Calendar now = Calendar.getInstance();
        date = now.getTime();
        monthItems = new ArrayList<SelectItem>();
        try {
            List<Date> monthList = amoritizateService.getMonthList();
            for(Date month:monthList){
                monthItems.add(new SelectItem(month, DateUtil.format(month, "yyyy - MM")));
            }
        } catch (Exception e) {
            LOG.error("ERROR!",e);
        }
        
    }
欏甸潰鍙互鐩存帴榪欐牱鍐欙細
<p:selectOneMenu value="#{amoritizateVM.date}" converter="monthItemConverter" style="width:145px">
      <f:selectItems value="#{amoritizateVM.monthItems}"></f:selectItems>
</p:selectOneMenu>
榪欓噷闈㈢敤鍒頒簡鍙﹀涓涓煡璇嗙偣Converter,鐢ㄦ潵杞崲綾誨埆錛屾瘮濡傝繖閲屾槸鐢ㄦ潵Date鍜孲tring鐨勪簰杞紝鎵浠ヨ鍐欎笂榪欎釜綾?br />
/**
鍙瀹炵幇瀹冪殑鎺ュ彛錛屽畠浼氳嚜鍔ㄥ畬鎴愯漿鎹紝榪樻槸寰堟柟渚跨殑
*/
@FacesConverter("monthItemConverter")
public class MonthItemConverter implements Converter {

    private static final Logger LOG = LoggerFactory.getLogger(MonthItemConverter.class);


    @Override
    public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
        return DateUtil.parseDate(arg2);
    }


    @Override
    public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
        return DateUtil.format((Date)arg2);
    }

}

4.琛ㄥ崟鎻愪氦鐨勮瘽錛岀敤榪欎釜
<p:commandButton value="Query" update="dataForm"/>
榪欓噷闈㈢殑update瑕佸搴旇繖涓〉闈㈤噷鐨刦orm鐨刬d
<h:form id="dataForm">


]]>
主站蜘蛛池模板: 平安县| 顺义区| 海门市| 闸北区| 舞阳县| 和静县| 浦县| 五大连池市| 德庆县| 东丰县| 隆昌县| 葵青区| 浮梁县| 巴东县| 东源县| 静宁县| 扎兰屯市| 广水市| 浮梁县| 崇阳县| 织金县| 札达县| 上林县| 满洲里市| 太白县| 平江县| 长岭县| 化隆| 石阡县| 昌平区| 昌都县| 涿鹿县| 藁城市| 太保市| 五指山市| 凤城市| 丘北县| 肥乡县| 淮滨县| 铁力市| 吉安市|