JavaBeat

  • Home
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Privacy
  • Contact Us

PrimeFaces Clock Example

April 16, 2014 by Amr Mohammed Leave a Comment

Primefaces provides a time component for taking the time from the user by using the Clock component. Clock displays server or client date time live. When it comes for displaying the server time, the Clock component provides AutoSync feature in server mode that can sync the clock with the server periodically.

1. Clock Tag Info

Primefaces Clock General Info

2. Clock Tag Attributes

Primefaces Clock Attributes

3. The View

index.xhtml

[code lang=”xml”]<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<script name="jquery/jquery.js" library="primefaces"></script>
</h:head>
<f:view>
<h:form prependId="false">
<h1>JavaBeat Primefaces Example</h1>
<h2>Primefaces – Clock</h2>
<p:clock mode="server" pattern="HH:mm:ss dd-MM-yyyy"></p:clock>
</h:form>
</f:view>
</html>[/code]

4. PrimeFaces Clock Demo

The below snapshot shows you the clock component, and how it’s rendered.

Primefaces Clock Example

[wpdm_file id=74]

Filed Under: JSF Tagged With: PrimeFaces

About Amr Mohammed

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow Us

  • Facebook
  • Pinterest

As a participant in the Amazon Services LLC Associates Program, this site may earn from qualifying purchases. We may also earn commissions on purchases from other retail websites.

JavaBeat

FEATURED TUTORIALS

Answered: Using Java to Convert Int to String

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Copyright © by JavaBeat · All rights reserved