Date Picker Form Control
The oxy_datePicker built-in form control is used for offering a text
field with a calendar browser that allows the user to choose a certain date in a specified
format.
The
oxy_datePicker form control supports the following properties:- edit - Lets you edit the value of an attribute, the text content of an element,
or Processing Instructions (PI). This property can have the following values:
- @attribute_name - The name of the attribute whose value is being edited. If the attribute is in a namespace, the value of the property must be a QName and the CSS must have a namespace declaration for the prefix.
- #text - Specifies that the presented/edited value is the simple
text value of an element.Note: You can set the value of the
visibilityproperty to-oxy-collapse-textto render the text only in the form control that theoxy_editorfunction specifies.
- columns - Controls the width of the form control. The unit size is the width of the w character.
- width - Specifies the width of the
content area using relative (
em,ex), absolute (in,cm,mm,pt,pc,px), and percentage (followed by the%character) length units. Thewidthproperty takes precedence over thecolumnsproperty (if the two are used together). - color - Specifies the foreground color
of the form control. If the value of the
colorproperty isinherit, the form control has the same color as the element that was used to insert it. - fontInherit - This value
specifies whether or not the form control inherits its font from its parent element. The
values of this property can be
trueorfalse(default value). To make the form control inherit its font from its parent element, set thefontInheritproperty totrue. - format - This property specifies the format of the inserted date. The pattern value must be a valid Java date (or date-time) format. If this property is missing, the format of the date is determined from the associated schema.
- visible - Specifies whether or not the form control is
visible. The possible values of this property are
true(default value) andfalse. - validateInput - Specifies if the form control is validated. If you introduce a
date that does not respect the format, the
datePickerform control is rendered with a red foreground. By default, the input is validated. To disable the validation, set this property tofalse. - hoverPseudoclassName - Allows
you to change the way an element is rendered when you hover over a form control. The value
is the name of a CSS pseudo-class. When you hover over the form control, the specified
pseudo-class will be set on the element that contains the form control.
p:before { content: oxy_datePicker(edit, "@attribute", hoverPseudoclassName, 'showBorder') } p:showBorder { border: 1px solid red; }
Example: oxy_datePicker Form
Control
date {
content:
oxy_label(text, "Date time attribute with
format defined in CSS: ", width, 300px)
oxy_datePicker(
columns, 16,
edit, "@attribute",
format, "yyyy-MM-dd");
}Tip: To insert a sample of the
oxy_datePicker form control in a CSS
file (or LESS file), invoke the Content Completion
Assistant by pressing Ctrl + Space (Command + Space on OS
X) and select the
oxy_datePicker code template.To see more detailed examples and more information about how form controls work in Oxygen XML Author, see the sample files in the following directory: [OXYGEN_INSTALL_DIR]/samples/form-controls.
For more information about form controls, watch our video demonstration: