简体   繁体   English

日历按钮未显示在jsf代码的结果页面上

[英]Calendar button not shown on result page of jsf code

I am a new learner of JSF. 我是JSF的新手。 I am trying to implement a sample calendar function, but not able to get the calendar button after running the xhtml page. 我正在尝试实现示例日历功能,但是在运行xhtml页面后无法获取日历按钮。 Could anyone please tell me the reason for the same. 谁能告诉我同样的原因。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">
<h:head>
    <title>Date and Time Picker</title>
</h:head>

<h:body>
    <h:form>
        Name : <h:inputText id="name" value="#{datePicker.name}"  
        a:placeholder="What's your name" />

        Date : <h:inputText id="date" value="#{datePicker.myDate}"  
        a:placeholder="What's your DOB" />  

        <rich:calendar value="#{datePicker.myDate}" id="myDate" popup="false"  datePattern="d/M/yy HH:mm"  buttonLabel="OpenCalendar" 
                cellWidth="24px" cellHeight="22px" />
            <br/>
        <h:commandButton value="Submit" action="response" />


    </h:form>
</h:body>
</html>

After RichFaces libraries where added into the project it is necessary to register them in project web.xml file. 将RichFaces库添加到项目后,有必要在项目web.xml文件中注册它们。 Add following lines in web.xml: 在web.xml中添加以下行:

<!-- Plugging the "Blue Sky" skin into the project -->

<context-param>

   <param-name>org.richfaces.SKIN</param-name>

   <param-value>blueSky</param-value>

</context-param>



<!-- Making the RichFaces skin spread to standard HTML controls -->

<context-param>

      <param-name>org.richfaces.CONTROL_SKINNING</param-name>

      <param-value>enable</param-value>

</context-param>



<!-- Defining and mapping the RichFaces filter -->

<filter> 

   <display-name>RichFaces Filter</display-name> 

   <filter-name>richfaces</filter-name> 

   <filter-class>org.ajax4jsf.Filter</filter-class> 

</filter> 



<filter-mapping> 

   <filter-name>richfaces</filter-name> 

   <servlet-name>Faces Servlet</servlet-name>

   <dispatcher>REQUEST</dispatcher>

   <dispatcher>FORWARD</dispatcher>

   <dispatcher>INCLUDE</dispatcher>

</filter-mapping>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM