git clone https://github.com/omidp/pfaces.git
mvn clean install -DskipTests=true -Pjsf
mvn clean install -DskipTests=true -Pprimefaces
- Add this in your web.xml
<servlet>
<servlet-name>pfaces-resource-serlvet</servlet-name>
<servlet-class>com.omidbiz.core.resources.ServletResource</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>pfaces-resource-serlvet</servlet-name>
<url-pattern>/pfaces/*</url-pattern>
</servlet-mapping>
<dependency>
<groupId>com.omidbiz</groupId>
<artifactId>pfaces</artifactId>
<version>0.0.1</version>
</dependency>
xmlns:pfaces="http://omidbiz.com/ui"
- add this into html head tag
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<h:outputScript library="primefaces" name="jquery/jquery-plugins.js" target="head" />
<script type="text/javascript" src="#{request.contextPath}/pfaces/pfaces.js" />
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/pfaces/pfaces.css" />
<pfaces:datePicker value="#{vacationHome.instance.fromDate}" showTime="true"></pfaces:datePicker>
Or without datetimepicker
<p:calendar value="#{vacationHome.instance.fromDate}" locale="fa"></pfaces:datePicker>
<pfaces:timeTable value="#{calendarEventHome.model}"></pfaces:timeTable>
@Name("calendarEventHome")
public class CalendarEventHome
{
DefaultCalendarModel model;
@Create
public void init()
{
List<CalendarEvent> events = new ArrayList<CalendarEvent>(0);
events.add(new DefaultCalendarEvent(UUID.randomUUID().toString(), "title 1", "data", new Date(), new Date()));
model = new DefaultCalendarModel(events);
}
public DefaultCalendarModel getModel()
{
return model;
}
}
Project includes
- jQuery 1.7
- jQuery ui 1.8.16
NOTE: If you are going to use datetime picker, you need to use this primefaces patch