Ui: issue with displaying calendar tag

I'm new to this JSF world, please bear with me if I ask for any stupid thing.

I am using UI tags for my application and I have a scenario where I need to create a calendar control so that the user can select the date when I followed the ui tag documents and wrote the code like this:

  <table width="100%">
    <tr>
    <td>
           <ui:calendar binding="#{booking.calDate}"
           id="calDate"
          dateFormatPattern="dd/MM/yyyy" 
          label="Date ::"/>
          </td>
          </tr>
     </table>

      

and my support bean contains

  private Calendar calDate = new Calendar();  

      

with appropriate getters and setters

when i tried to load the page i get the calendar component. I am getting cross-marks and pointless stuff with some javascript errors.

please help me to solve this problem.

Thanks in anticipation

0


source to share


3 answers


I got the solution myself - the problem is with the javascript code. it reads the javascript from topic.jar which I put in the web-inf / lib folder but it couldn't access that. so i extracted the same and put it in web-inf and it works fine



+1


source


Is the component coming from a JSF library? In other words, what do you have at the beginning of your XHTML file?

The only library I know comes from Facelets and it doesn't provide any component!



Also, if calDate is ** java.util. ** Calendar class, then you cannot bind this class to a JSF component!

Perhaps you can have a look at Tomahawk or Richfaces that provide a nice calendar component ...

0


source


Are you using MyFaces? If so, you may need to customize the MyFaces filter . This loads JavaScript and images, etc. And it could be the cause of JavaScript and image loading problems.

Obviously, if you're not using MyFaces, this is not a problem!

0


source







All Articles