schedule listeners does not fire!

UI Components for JSF
Post Reply
arashbahal
Posts: 25
Joined: 12 Jul 2010, 18:21

28 Aug 2010, 08:45

hi all
i have tried to write a simple page containing scheduler
it looks fine but the listeners like eventSelectListener,dateSelectListener,eventMoveListener never fired!
what is the problem
this is my code:

Code: Select all

<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@taglib uri="http://primefaces.prime.com.tr/ui" prefix="p"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">

	<title>My JSF 'Calendar.jsp' starting page</title>
	
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>
  
<body>
	<f:view>
	<p:resources/>
		<h:form>
		<p:schedule value="#{ScheduleBean.model}" editable="true"  aspectRatio="4"
		eventSelectListener="#{ScheduleBean.onEventSelect}"
		dateSelectListener="#{ScheduleBean.onDateSelect}"
		eventMoveListener="#{ScheduleBean.onEventMove}"
		>
		</p:schedule>
		</h:form>
	</f:view>
</body>
</html>

and my back bean is:

Code: Select all

package com.pardis.calendar.model;

import java.util.HashMap;
import java.util.List;

import javax.annotation.PostConstruct;

import org.primefaces.event.DateSelectEvent;
import org.primefaces.event.ScheduleEntryMoveEvent;
import org.primefaces.event.ScheduleEntrySelectEvent;
import org.primefaces.model.DefaultScheduleModel;
import org.primefaces.model.ScheduleModel;

import com.fanava.genericmanagedbeans.utls.ManagedBeanUtils;
import com.pardis.calendar.dm.calendar.CalendarBean;
import com.pardis.calendar.dm.user.UserBean;

public class ScheduleBean {
	private ScheduleModel model;
	private int userId;
	private int systemId;

	public int getSystemId() {
		return 1;
	}

	public void setSystemId(int systemId) {
		this.systemId = systemId;
	}

	public ScheduleBean() {
		model = new DefaultScheduleModel();
	}
	@PostConstruct
	public void Initialize() {
		...
	}
	public void onEventSelect(ScheduleEntrySelectEvent selectEvent){
		System.out.println("done");
	}
	public void onDateSelect(DateSelectEvent selectEvent) {
		System.out.println("done");
		}
	public void onEventMove(ScheduleEntryMoveEvent selectEvent) {
		System.out.println("move");
		}

	public ScheduleModel getModel() {
		return model;
	}

	public int getUserId() {
		return 1;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}
}

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Aug 2010, 14:06

They are working fine at;

http://www.primefaces.org/labs/ui/schedule.jsf

Try with Facelets if you can instead of jsp.

arashbahal
Posts: 25
Joined: 12 Jul 2010, 18:21

29 Aug 2010, 13:03

thanks for your reply
i have followed the instruction in sample
but it does not work!
i don't want to use XHTML
the example is somehow weird!
the back bean does not has getEvent method but it has been used in tags!
please help me

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Aug 2010, 13:04

Why don't you want to use Facelets? JSP is deprecated in JSF.

arashbahal
Posts: 25
Joined: 12 Jul 2010, 18:21

29 Aug 2010, 13:31

our project's constraints don't let me to use XHTML

arashbahal
Posts: 25
Joined: 12 Jul 2010, 18:21

29 Aug 2010, 14:41

is any help?!!!

arashbahal
Posts: 25
Joined: 12 Jul 2010, 18:21

30 Aug 2010, 15:32

how can i get the full source code of :
http://www.primefaces.org/labs/ui/schedule.jsf
????

marco
Posts: 66
Joined: 14 Jun 2010, 17:25

30 Aug 2010, 15:46

besides that the code is directly visible at the linked page, a short look on your code showed, that you have used wrong names for managed beans in your jsp.

You are using #{ScheduleBean.model}" but with standard naming scheme it should be "#{scheduleBean.model}"

Don't know if there are any more errors.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 61 guests