webuijsf
Tag scheduler


Use the webuijsf:scheduler tag to display a calendar and the input controls that are used for selecting a date and time. The webuijsf:scheduler tag's attributes allow you to associate the component with a value (a com.sun.webui.jsf.model.ScheduledEvent), and to configure how the input controls are rendered.

HTML Elements and Layout

The Scheduler component displays a monthly calendar, consisting of a <table> element with cells that contain hyperlinks for each day of the month. When a date link is clicked, the associated date is displayed in the Start Date field. The current month is displayed initially by default, and the user can select a different month by using a drop-down menu. Hyperlinked icons to the left and right of the Month menu can be used to go to the previous and next months. Another drop-down menu can be used to select a different year.

The Start Time is always rendered by the component, and consists of separate drop-down menus for the hour and minute. The user is required to enter values for Start Date and Start Time, so those subcomponents of the Scheduler are annotated as required by default.

Additional input controls for End Time, Repeat Interval, and Repeat Limit are rendered by default to allow detailed scheduling control by the user. These input controls can be removed by setting webuijsf:scheduler tag attributes. The Scheduler component also renders a button to allow users to preview their scheduled events in the calendar, where days with scheduled events appear as highlighted cells in the table.

The following diagram shows the layout of the Scheduler component. The diagram represents the default calendar, which includes all available input controls.

 
* Indicates required field
 < 
 > 
 
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 1 2 3 4
 
mm/dd/yyyy
   
: GMT-05:00
   
: GMT-05:00
 
   
 
   
     
Blank value repeats forever
   
 

Configuring the webuijsf:scheduler Tag

Use the value attribute to associate the component with a model object that represents the current value. The model object must be of type com.sun.webui.jsf.model.ScheduledEvent.

Schedule data entered by the user is automatically converted to and from the ScheduledEvent.

You can use webuijsf:scheduler tag attributes to configure the appearance of the Scheduler. By default, input elements for Start Date, Start Time, End Time, Repeat Interval, and Repeat Limit are shown. You can specify your own labels for the input elements. You can also suppress the display of most of the elements. All but the Start Date are optional. To suppress the End Time element, set endTimerepeating to false; to suppress just the Repeat Limit controls, set limitRepeating to false.

You can also prevent display of the Preview in Calendar button by setting previewButton to false.

To configure a range of dates that can be selected, specify the minDate and maxDate attributes.

The range of years available in the Calendar display is derived from the the minDate and maxDate attributes.

Facets

None.

Client-side JavaScript Functions

None.

Examples

Example 1: Basic Scheduler

This example uses all the input elements, but changes the labels for the dates and times.

 
     <webuijsf:scheduler id="scheduler" 
                   dateLabel="Date: " 
                   startTimeLabel="Start: "
                   endTimeLabel="End: " 
                   value="#{SchedulerBean.event}"/>
 

Example 2: Scheduler without End Time or Repeating Events

This example disables the End Time, Repeat Interval, and Repeat Limit controls.

 
     <webuijsf:scheduler id="scheduler" 
                   dateLabel="Date: " 
                   startTimeLabel="Start: "
                   repeating="false"
                   endTime="false"
                   value="#{SchedulerBean.event}"/>
 

SchedulerBean Used in Examples

import com.sun.webui.jsf.model.ScheduledEvent;

public class SchedulerBean {

   // Creates a new instance of SchedulerBean

    public SchedulerBean() {
    }

  //
  // Holds value of property event.
  //
    private ScheduledEvent event = null;

    //
    // Getter for property event.
    // @return Value of property event.
    //
    public ScheduledEvent getEvent() {

        return this.event;
    }

    //
    // Setter for property event.
    // @param event New value of property event.
    //
 
    public void setEvent(ScheduledEvent event) {

        this.event = event;
    }

    ...

}



Tag Information
Tag Classcom.sun.webui.jsf.component.SchedulerTag
TagExtraInfo ClassNone
Body ContentJSP
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
bindingfalsefalsejava.lang.String A ValueExpression that resolves to the UIComponent that corresponds to this tag. This binding allows the Java bean that contains the UIComponent to manipulate the UIComponent, its properties, and its children.
repeatIntervalLabelfalsefalsejava.lang.String

Override the default value of the label for the repeat interval menu.

repeatIntervalItemsfalsefalsejava.lang.String

Override the items that appear on the repeat interval menu. The value must be one of an array, Map or Collection whose members are all subclasses of com.sun.webui.jsf.model.scheduler.RepeatIntervalOption, whose values must be one of the member classes of com.sun.webui.jsf.model.scheduler.RepeatInterval, for example com.sun.webui.jsf.model.scheduler.RepeatInterval.ONETIME or com.sun.webui.jsf.model.scheduler.RepeatInterval.HOURLY. If this attribute is not specified, default options of "One Time", "Hourly", "Weekly", "Monthtly" will be shown.

requiredLegendfalsefalsejava.lang.String

Flag indicating if the "* indicates required field" message should be displayed - default value is true.

dateFormatPatternHelpfalsefalsejava.lang.String

A message below the text field for the date, indicating the string format to use when entering a date as text into the Start Date text field.

The component internally relies on an instance of java.text.SimpleDateFormat to produce the hint. The default hint is constructed by invoking the toLocalizedPattern() method on the SimpleDateFormat instance and converting this String to lower case.

Due to a bug in SimpleDateFormat, toLocalizedPattern() does not actually produce locale-appropriate strings for most locales (it works for German, but not for other locales). If the default value for the dateFormtPattern is used, the component takes care of the localization itself, but if the default is overridden, you may need to override the hint on a per-locale basis too.

minDatefalsefalsejava.lang.String

A java.util.Date object representing the first selectable day. The default value is today's date.

The value of this attribute is reflected in the years that are available for selection in the month display. In future releases of this component, web application users will also not be able to view months before this date, or select days that precede this date. At present such dates can be selected, but will not be validated when the form is submitted.

endTimefalsefalsejava.lang.String

Flag indicating that an input field for the end time should be shown. The default value is true.

dateFormatPatternfalsefalsejava.lang.String

The date format pattern to use (i.e. yyyy-MM-dd). The component uses an instance of java.text.SimpleDateFormat and you may specify a pattern to be used by this component, with the following restriction: the format pattern must include yyyy (not yy), MM, and dd; and no other parts of time may be displayed. If a pattern is not specified, a locale-specific default is used.

If you change the date format pattern, you may also need to change the dateFormatPatternHelp attribute. See the documentation for that attribute.

startTimeLabelfalsefalsejava.lang.String

This text replaces the "Start Time" label.

maxDatefalsefalsejava.lang.String

A java.util.Date object representing the last selectable day. The default value is four years after the minDate (which is evaluated first).

The value of this attribute is reflected in the years that are available for selection in the month display. In future releases of this component, web application users will also not be able to view months after this date, or select days that follow this date. At present such dates can be selected, but will not be validated when the form is submitted.

styleClassfalsefalsejava.lang.String

CSS style class(es) to be applied to the outermost HTML element when this component is rendered.

stylefalsefalsejava.lang.String

CSS style(s) to be applied to the outermost HTML element when this component is rendered.

startTimefalsefalsejava.lang.String

Flag indicating that an input field for the start time should be shown. The default value is true.

repeatingfalsefalsejava.lang.String

Flag indicating that a control for scheduling a repeated event should be shown. The default value is true.

timeZonefalsefalsejava.lang.String

The java.util.TimeZone used with this component. Unless set, the default TimeZone for the locale in javax.faces.component.UIViewRoot is used.

valuefalsefalsejava.lang.String The current value of this component.
endTimeLabelfalsefalsejava.lang.String

This text replaces the "End Time" label.

limitRepeatingfalsefalsejava.lang.String

Flag indicating that a control for setting a limit for repeating events should be shown. The default value is true.

previewButtonfalsefalsejava.lang.String

Flag indicating that the "Preview in Browser" button should be displayed - default value is true.

repeatLimitLabelfalsefalsejava.lang.String

Override the default value of the label for the repeat limit menu.

repeatUnitItemsfalsefalsejava.lang.String

Override the items that appear on the repeat limit unit menu. The value must be one of an array, Map or Collection whose members are all subclasses of com.sun.webui.jsf.model.Option, and the value of the options must implement the com.sun.webui.jsf.model.RepeatUnit interface. The default value is to show a menu with values "Hours", "Days", "Weeks", "Months".

visiblefalsefalsejava.lang.String

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

readOnlyfalsefalsejava.lang.String

If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined. NOT YET IMPLEMENTED.

dateLabelfalsefalsejava.lang.String

This text replaces the "Start Date" label.

tabIndexfalsefalsejava.lang.String

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.

immediatefalsefalsejava.lang.String Flag indicating that event handling for this component should be handled immediately (in Apply Request Values phase) rather than waiting until Invoke Application phase.
validatorExpressionfalsefalsejava.lang.String Used to specify a method in a backing bean to validate input to the component. The value must be a JavaServer Faces EL expression that resolves to a public method with return type void. The method must take three parameters:
  • a javax.faces.context.FacesContext
  • a javax.faces.component.UIComponent (the component whose data is to be validated)
  • a java.lang.Object containing the data to be validated.

The backing bean where the method is defined must implement java.io.Serializable or javax.faces.component.StateHolder.

The method is invoked during the Process Validations Phase.

renderedfalsefalsejava.lang.String Indicates whether the HTML code for the component should be included in the rendered HTML page. If set to false, the rendered HTML page does not include the HTML for the component. If the component is not rendered, it is also not processed on any subsequent form submission.
valueChangeListenerExpressionfalsefalsejava.lang.String Specifies a method to handle a value-change event that is triggered when the user enters data in the input component. The attribute value must be a JavaServer Faces EL expression that resolves to a backing bean method. The method must take a single parameter of type javax.faces.event.ValueChangeEvent, and its return type must be void. The backing bean where the method is defined must implement java.io.Serializable or javax.faces.component.StateHolder.
idfalsetruejava.lang.StringNo Description

Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.