Richfaces组件使用指南

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Richfaces组件使用指南1先从一个简单的例子入手1.1下载最新的richfaces组件3.2.11.1.1下载地址:组件位于JBoss项目中。1.2安装1.2.1解压”GA-bin.zip”1.2.2Copy”richfaces-ui-3.2.1.GA.jar”,”richfaces-impl-3.2.1.GA.jar”,”richfaces-api-3.2.1.GA.jar”到web应用的”WEB-INF/lib”下。1.2.3在”WEB-INF/web.xml”中添加如下内容:context-paramparam-nameorg.richfaces.SKIN/param-nameparam-valueblueSky/param-value/context-paramcontext-paramparam-namejavax.faces.STATE_SAVING_METHOD/param-nameparam-valueserver/param-value/context-paramfilterdisplay-nameRichFacesFilter/display-namefilter-namerichfaces/filter-namefilter-classorg.ajax4jsf.Filter/filter-class/filterfilter-mappingfilter-namerichfaces/filter-nameservlet-nameFacesServlet/servlet-namedispatcherREQUEST/dispatcherdispatcherFORWARD/dispatcherdispatcherINCLUDE/dispatcher/filter-mappinglistener1.2.4在jsp文件的头部添加:%@tagliburi==a4j%%@tagliburi==rich%xhtml文件的头部添加:xmlns:a4j=:rich=工程1.3.1JSP页面%@pagelanguage=javapageEncoding=GB18030%%@tagliburi==h%%@tagliburi==f%%@tagliburi==a4j%%@tagliburi==rich%htmlheadtitleMyJSF'echo.jsp'startingpage/title/headstyletype=text/css.ecol1{vertical-align:top;padding-right:25px}.ecol2{vertical-align:top;border-left:#ACBECE1pxsolid;padding-left:10px}.rich-calendar-tool-btn{font-family:Arial,Verdana;}/stylebodyf:viewh:formrich:panelheader=Simpleechoh:inputTextsize=50value=#{panelBean.text}a4j:supportevent=onkeyupreRender=rep/a4j:support/h:inputTexth:outputTextvalue=#{panelBean.text}id=rep/h:outputText/rich:panel/h:form/f:view/body/html1.3.2DataBeanpackagecom.csky.demo;publicclassPanelBean{privateStringtext;publicPanelBean(){}publicvoidsetText(Stringtext){this.text=text;}publicStringgetText(){returnthis.text;}}1.3.3faces-config.xml?xmlversion=1.0encoding=UTF-8?!DOCTYPEfaces-configPUBLIC-//SunMicrosystems,Inc.//DTDJavaServerFacesConfig1.1//EN=1.0encoding=UTF-8?web-appxmlns=:xsi==2.4xsi:schemaLocation=://java.sun.com/xml/ns/j2ee/web-app_2_4.xsdcontext-paramparam-namejavax.faces.CONFIG_FILES/param-nameparam-value/WEB-INF/faces-config.xml/param-value/context-paramcontext-paramparam-nameorg.richfaces.SKIN/param-nameparam-valueblueSky/param-value/context-paramcontext-paramparam-namejavax.faces.STATE_SAVING_METHOD/param-nameparam-valueserver/param-value/context-paramfilterdisplay-nameRichFacesFilter/display-namefilter-namerichfaces/filter-namefilter-classorg.ajax4jsf.Filter/filter-class/filterfilter-mappingfilter-namerichfaces/filter-nameservlet-nameFacesServlet/servlet-namedispatcherREQUEST/dispatcherdispatcherFORWARD/dispatcherdispatcherINCLUDE/dispatcher/filter-mappinglistenerlistener-classcom.sun.faces.config.ConfigureListener/listener-class/listenerservletservlet-nameFacesServlet/servlet-nameservlet-classjavax.faces.webapp.FacesServlet/servlet-classload-on-startup0/load-on-startup/servletRichfaces皮肤配置Richfacesfilter配置servlet-mappingservlet-nameFacesServlet/servlet-nameurl-pattern*.jsf/url-pattern/servlet-mappinglogin-configauth-methodBASIC/auth-method/login-configwelcome-file-listwelcome-fileindex.jsp/welcome-file/welcome-file-list/web-app1.3.5Deployment完成部署,访问。2Richfaces组件介绍2.1a4j:ajaxListener2.1.1.1描述:这个组件类似于f:actionListener或f:valueChangeListener,但是它包含了一个ajax容器。负责事件监听。2.1.1.2ajaxListener属性:属性名描述Type2.1.1.3例子:a4j:ajaxListenertype=demo.Bean/2.1.1.42.2a4j:keepAlive2.2.1.1描述:2.2.1.2keepAlive属性:属性名描述ajaxOnlyiftrue,beanvaluerestoredinajaxrequestsonly.beanNamenameofbeanforEL-expressions.2.2.1.3例子:a4j:keepAlivebeanName=testBean/2.2.1.42.3rich:calendar2.3.1.1描述:是一个日历控件。2.3.1.2Calendar属性:2.3.1.3例子:a4j:outputPanelid=calendarlayout=blockrich:calendarvalue=#{calendarBean.selectedDate}locale=#{calendarBean.locale}popup=#{calendarBean.popup}datePattern=#{calendarBean.pattern}showApplyButton=#{calendarBean.showApply}cellWidth=24pxcellHeight=22pxstyle=width:200px//a4j:outputPanel2.4rich:comboBox2.4.1.1描述:下拉列表框,提供了动态绑定数据功能2.4.1.2comboBox属性:2.4.1.3例子:rich:comboBoxvalue=#{bean.state}valueChangeListener=#{bean.selectionChanged}f:selectItemsvalue=#{bean.selectItems}/f:selectItemit

1 / 10
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功