现在的位置: 首页 > 综合 > 正文

web用户界面设计 jsf 第三方组件t标签ICEfaces标签

2013年10月06日 ⁄ 综合 ⁄ 共 4638字 ⁄ 字号 评论关闭

tomcat中部署*.war文件。
放到tomcat的webapps中就可以了。
启动时的工程名字就是打包文件的名字,如
hello.war
http://localhost:8080/hello/index.jsp
可以了。

 

web用户界面设计
更多的组件:
一(t标签)
http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc.html

1.日期/时间输入组件
<t:inputDate type="{date|time|both|short_time|full}"
                popupCalendar="{true|false}"
                ampm="{true|false}"/>

date是选择日期,time是时分钟。
both是日期时分钟。
shot_time是输入今天的小时分钟。
full是日期时分钟秒
ampm:If true, use 12hr times with AM/PM selector; if false, use 24hr time. Default false.
<t:inputDate type="date" value="#{adminBean.admin.registerTime}"
                popupCalendar="true"/>
2.选项卡
样式怎么控制
<t:panelTabbedPane selectedIndex="1" bgcolor="#FFFFFF"  >
       <t:panelTab label="周统计">
        内容1
       </t:panelTab>
        <t:panelTab label="月统计">
       内容2
       </t:panelTab>
                              此区域: 每个标签都显示的内容
   </t:panelTabbedPane>

3验证
数字范围:
 <f:validateLongRange minimum="1" maximum="10" />
字符范围:
   <f:validateLength minimum="3" maximum="7"/>
message.properties
javax.faces.validator.LongRangeValidator.NOT_IN_RANGE
验证错误:输入的值必须在{0}和{1}之间.
4
*

FacesContext facesContext = FacesContext.getCurrentInstance();

        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
        Validator[] validators = number1.getValidators();
        if (validators == null || validators.length == 0)
        {
            number1.addValidator(new LongRangeValidator(10, 1));
        }

 <t:messages id="messageList" styleClass="error" summaryFormat="{0} in {1}" />

取当前日期
  <managed-bean>
        <managed-bean-name>date1</managed-bean-name>
        <managed-bean-class>java.util.Date</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>

#{date1}

 PS:http://myfaces.apache.org/tomahawk/index.html
例子见csdn空间6/myfaces-example-simple-1.1.9.war
部署到web服务器上就可以了。
--------------------------------------------------
IceFaces 是一个符合Ajax 标准的 JSF 框架
二ICEfaces标签( ICEfaces Component Suite)

http://component-showcase.icefaces.org/
Rich Text
File Upload(带进度条的上传)
Table/Data paginator
Table/Row Selection
Table/Sortable Header

Layout Panels/Collapsile Panel
Layout Panels/Popup Panel
Layout Panels/Static Tabset 选项卡
Layout Panels/Tooltip Panel  提示面板
                                     可用来展商的制作

 

怎么配置不了。。。
1.加icefaces.jar,icefaces-comps.jar
2.basicTable.jspx
<f:view xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ice="http://www.icesoft.com/icefaces/component">
 <ice:......

3.web.xml
<context-param>
        <param-name>com.icesoft.faces.debugDOMUpdate</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
        <description>
            State saving method: "client" or "server" (= default)
            See JSF Specification 2.5.2
        </description>
    </context-param>
   
    <context-param>
        <param-name>com.icesoft.faces.uploadDirectory</param-name>
        <param-value>upload</param-value>
    </context-param>
   
    <!-- concurrent DOM views -->
    <context-param>
        <param-name>com.icesoft.faces.concurrentDOMViews</param-name>
        <param-value>false</param-value>
    </context-param>
    <!-- Asynchronous Updates -->
    <context-param>
        <param-name>com.icesoft.faces.synchronousUpdate</param-name>
        <param-value>false</param-value>
    </context-param>

 <listener>
  <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
 </listener>
    <listener>
        <listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
    </listener>

    <!-- file upload Servlet -->
    <servlet>
         <servlet-name>uploadServlet</servlet-name>
         <servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
         <load-on-startup> 1 </load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>Persistent Faces Servlet</servlet-name>
        <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
        <load-on-startup> 1 </load-on-startup>
    </servlet>
   <!-- extension mapping -->
 <servlet-mapping>
         <servlet-name>uploadServlet</servlet-name>
         <url-pattern>/uploadHtml</url-pattern>
    </servlet-mapping>  
    <servlet-mapping>
        <servlet-name>Persistent Faces Servlet</servlet-name>
        <url-pattern>*.iface</url-pattern>
    </servlet-mapping>

4 IE中启动 *.iface

 

icefaces for eclipse plugin
等会安插件就好了。
for myeclipse

ICEfaces-1.8.1-Eclipse-3.4.2-plugins.zip

*****成功了,例子见
csdn空间6/simpleIceFaces 工程

整合有点小问题。。。。是包不兼容的问题。版本问题?

tld

11:37:59,781 ERROR Digester:1439 - Parse Error at line 2 column 14: Document root element "faces-config", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "faces-config", must match DOCTYPE root "null".
icefaces.org

 

 

抱歉!评论已关闭.