You see the Properties window for a Calendar component when you select the component on a page that you are editing in the Visual Designer.
Most of the Calendar component's properties are both JSP attributes and properties of the Calendar Java component in the page bean.
This component has the following properties.
General
id. Type: String
The name of the Calendar component in the page bean and the JSP file.
Appearance
columns. Type: int
The number of character columns used to render the component. The default value is 20.
dateFormatPattern. Type: String
The format of the date to be entered by the user. It is not usually necessary to set this property because a pattern is chosen automatically based on the locale.
If you prefer to specify a date format, click the ellipsis button (...) to the right of the property and select a predefined date format from the property editor's list. You can also add your own formats.
If you add a format, the values you can enter are limited
to some combination of yyyy for the year, MM for the month, and dd for the day separated by separator characters. Typical separator characters are / (slash), . (period), and - (dash). For example, the following date formats are acceptable:
MM/dd/yyyy
yyyy.MM.dd
MM-dd-yyyy
dateFormatPatternHelp. Type: text
Text that appears below the date entry field and shows the format pattern that the date entry field accepts. If you have not set the dateFormatPattern property, the help text is chosen automatically for you. If you have set the dateFormatPattern property, you should bind the dateFormatPatternHelp property to a localized string that matches the setting for each locale you want to support.
label. Type: String
A label that appears next to the text entry field, typically describing what the user is supposed to enter.
The label property is not as flexible as the Label component. You can use the Label component if you want more control over the label's appearance, such as positioning of the label relative to the component.
labelLevel. Type: int
A number that affects the appearance of the label. 1 (Strong) is larger and bold. 2 (Medium), the default, is smaller and bold. 3 (Weak) is smaller and normal (not bold). This property takes effect only if the label property is set.
style. Type: String
Cascading Style Sheet rules (CSS level 2) to be applied to the component. For example:
position: absolute; left: 288px; top: 312px
You can enter values directly or click the ellipsis (...) button to use the Style Editor.
This property overrides any settings in the theme or the project CSS file for this component. If a style specified in this property does not appear to take effect, it is because an area of the component is obscured by a child component that has different style settings.
For a list of CSS2 style attributes, see the web page at
styleClass. Type: String
A space-separated list of CSS2 style classes to be applied when the component is rendered. The style classes must be defined in the project's style sheet or in the theme's CSS file. If you click the ellipsis button (...), you see a list of all styles you can add to this property. For information on adding CSS classes and rules to the project's cascading style sheet, see CSS Editor.
See the note above under the style property description for an explanation of why a class added to this property might appear to have no effect on the component.
If you add a CSS style class from the current theme to your project CSS file and you redefine the style class, the change affects all components that use this style class. However, you can add your own style classes to the project CSS file that redefine the default style classes, and then when you add them to this property, the changes affect only this instance of this component.
maxDate. Type: java.util.Date
The last date that the user can select. The default value is four years from the date set in the minDate property, for a total span of five years.
minDate. Type: java.util.Date
The earliest date that the user can select. The default value is the value of the selectedDate property, which defaults to the current date if that property is not set.
required. Type: boolean
If selected, the user must enter a value for the calendar before the page can be submitted. If you add a Message component to the page and link its for property to this component, an error message will be displayed if the user tries to submit the page without entering a value.
selectedDate. Type: Date
A java.util.Date object representing the calendar date selected by the user. If you right-click the component and choose Bind to Data, you can bind this property to a data provider or object that can process the user entered value on the server.
When the component displays initially, if this property is not set, its value defaults to the current date. If you provide values for minDate and maxDate, you can also provide a value for this property that initially displays a date in that range.
validator. Type: MethodBinding
Indicates the JavaServer Faces validator that is called when the value is submitted. A validator ensures that the correct value is entered by a user. Choose a validator from the drop down list. If you choose (null), no validator is called. If you choose a validator, also select the required property to ensure that the validator is used.
If you define your own validate method, for example, by right-clicking the component and choosing Edit Event Handler > validate, any value you might have set in this property is overridden.
Events
Set the event properties by right-clicking the component in the Visual Designer and choosing Edit Event Handler > eventname.
validate. Indicates the name of the method that is called to validate the value of the component. If you want to code a validate method, right-click the component in the Navigator window and choose Edit Event Handler > validate. The default name for the method is component-id_validate, where component-id is the value of the component's id property.
valueChangeListener Indicates the name of the component value change listener method that is called when the value of the component changes. You typically define this method in the page bean by right-clicking the component in the Navigator window and choosing Edit Event Handler > processValueChange. The default name for the method is component-id_processValueChange, where component-id is the value of the id property.
Behavior
disabled. Type: boolean
If selected, indicates that the component should never receive focus or be included in a submit. Use this property when the component does not apply to the page. See the note under the readOnly property concerning the effects of using the disabled property versus the effects of using the readOnly property.
readOnly. Type: boolean
If selected, makes it impossible for the user to enter values, but still makes it possible for the component's value to be submitted.
Use this property when the component does apply but must not be changed.
A readonly field is included when the page is submitted, in contrast to a disabled field, which is not included when the page is submitted. If you use the disabled property, JavaServer Faces does not detect that any value at all was submitted.
toolTip. Type: String
Sets the HTML title attribute for date entry field. The text value of this property displays if the user hovers the mouse cursor over the entry field.
If the component is disabled, the tooltip will not display in most browsers.
visible. Type: boolean
Indicates whether or not the component can be seen by the user on the rendered HTML page. This property is selected by default. If you deselect this property, the component's HTML code is rendered on the page, but the component is not visible in the browser because it is hidden by a style setting. Because the HTML code is rendered, the component can still be processed on form submissions, and users who view source in the browser can see the HTML code. In addition, your web application can use client-side JavaScript to show or hide the component.
If you need to completely hide the component, for example, because it contains sensitive information that certain users should not see, deselect the rendered property.
Accessibility
tabIndex. Type: String
Optionally specifies the position of the calendar in the tab order of the document, determining when the component gets focus if the user tabs through the document. The value must be an integer between 0 and 32767.
JavaScript
onBlur. Type: String
JavaScript to be executed when the component loses focus.
onChange. Type: String
JavaScript to be executed when the component loses focus and its value was modified after it gained focus.
onClick. Type: String
JavaScript to be executed when the user clicks the component.
onDblClick. Type: String
JavaScript to be executed when the user double-clicks the component.
onFocus. Type: String
JavaScript to be executed when the component gains focus.
onKeyDown. Type: String
JavaScript to be executed when the component has focus and a key is pressed.
onKeyPress. Type: String
JavaScript to be executed when the component has focus and a key is pressed and released.
onKeyUp. Type: String
JavaScript to be executed when the component has focus and a key is released.
onMouseDown. Type: String
JavaScript to be executed when the mouse cursor is over the component and the user presses down on the mouse button.
onMouseMove. Type: String
JavaScript to be executed when the user moves the mouse cursor within the component.
onMouseOut. Type: String
JavaScript to be executed when the user moves the mouse cursor away from the component after it has been over the component.
onMouseOver. Type: String
JavaScript to be executed when the user moves the mouse cursor onto the component.
onMouseUp. Type: String
JavaScript to be executed when the mouse cursor is over the component and the user releases the mouse button.
onSelect. Type: String
JavaScript to be executed when the user selects text in the component.
Advanced
immediate. Type: boolean
If this property is selected, when the user finishes entering a date in the calendar, the code in the page bean is executed before validation, updating of model values, and so on. Essentially, code execution happens right away on the server, which then returns the page. A simpler way of getting this functionality is to associate the component with a virtual form, and then right-click the component and choose Auto-Submit on Change.
rendered. Type: boolean
If selected, the calendar is to be rendered and processed on any subsequent page submission. If not selected, the calendar does not appear on the page at all, not even as a hidden component.
valueChangeListener. Type: MethodBinding
See the Event section's valueChange property above, which provides an easier way to set this property's value. The valueChangeListener property is the MethodBinding that underlies the valueChange event property. The valueChangeListener property is updated when you set the method for the valueChange event property.
If you click the ellipsis button next to the valueChange property, you can use that property's property editor to choose an existing method to bind to, or you can create a new method or unbind an existing method. If you are an expert, instead of using the valueChange property, you can type a MethodBinding expression directly into this valueChangeListener property, for example, if you want to call a method that is not in the page bean.