Can you add a schedule comp to a panel in a backing bean

UI Components for JSF
Post Reply
jwatters1981
Posts: 7
Joined: 09 Dec 2010, 23:54

10 Dec 2010, 18:19

Below is my code which should add a schedular to a panel

Code: Select all

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import javax.faces.bean.ManagedBean;
import javax.faces.component.html.HtmlPanelGrid;
import org.primefaces.component.schedule.Schedule;

/**
 *
 * @author jwatters
 */
@ManagedBean(name = "scheduleBean")
public class TestSchedule {

    private HtmlPanelGrid panel = new HtmlPanelGrid();

    public TestSchedule() {
        Schedule schedule = new Schedule();
        panel.getChildren().add(schedule);
    }

    /**
     * @return the panel
     */
    public HtmlPanelGrid getPanel() {
        return panel;
    }

    /**
     * @param panel the panel to set
     */
    public void setPanel(HtmlPanelGrid panel) {
        this.panel = panel;
    }
}


xhtml page

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head> 
    <f:view>
        <f:subview id="sc">
            <h:body>
                <h:form>                
                    <h:panelGrid binding="#{scheduleBean.panel}"></h:panelGrid>  
                </h:form>
            </h:body>
        </f:subview>
    </f:view>
</html>


But when I view the page it doesn't show the schedular and gives the below error

Error: jQuery is not defined
Source File: http://localhost:8080/WebApplication1/
Line: 10

its not including the javascript resource

if I use

Code: Select all


<p:schedule/>
it works fine

any ideas?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 60 guests