You are here: User interface > User interface rules > Harness, Section, and Flow Action forms > Harness and Section formsAdding a Calendar control

Harness and Section forms
Adding a Calendar control

A cell in a layout can present the value of a property as a date, time, or both in display-only or editable format. Follow these instructions to present a property value in a Calendar control.

The Calendar control uses the auto-generated control pxDateTime. Its appearance and behavior are governed by the Control rule form Control tab. The Parameters tab is not available and the HTML cannot be edited. As a best practice, do not modify a copy of the rule. Instead, use the Parameters dialog available in the control's Cell Properties panel while designing a section, flow action, or harness. See Completing the Control tab.

As a best practice, use pxDateTime in new development rather than the non-auto-generated date and time controls (which are supported). For information about the older control, see The Version 5 Calendar control.

The UI Gallery landing page contains a working example of this control. To view and interact with this example and review its configuration, select Designer Studio> User Interface > UI Gallery and select Date/Time in the Components group.

1. Drag and Drop the Calendar control

Click the down-arrow (Arrow) at the right end of the Basic control group () and select the Calendar control (). Drag the control to the cell or header that is to contain the property value. When the pointer changes shape to indicate that a single cell is selected, release the mouse button to drop the control.

If the cell is not empty, the dropped control replaces the current contents of the cell.

2. Complete the Cell Properties panel — Top fields

Click (Magnifying glass) to open the Cell Properties panel. Complete the top fields that appear.

If the panel is pinned (Pinned), the wireframe presentation on the rule form changes immediately to reflect of your inputs. If the panel is not pinned (not pinned), click Apply to apply your inputs.

Field

Description

magnifying glass

Appears only when this field is in a section included within the current open rule. Click to open the section that immediately contains the field.

Property

Select or type a property reference that identifies a single text value and has a Property Type of DateTime, Date, TimeOfDay or Text.

Alternatively, you can drag a property name from the lists of properties visible in the Application Explorer. Typically, this works for Single Value properties belonging to in the Applies to class of the current rule (or a higher class). If the container in which this field sits has a non-blank Using Page value, you can drag a Single Value property from within that embedded page property.

Click (magnifying glass) to review the property (if the reference is to an existing property in the Applies To class of this rule or a parent of that class). If the property is not found, the New dialog box for the property form appears.

You can reference properties on any page identified on the Pages & Classes tab, using the normal notation pagename.propertyname for pages other than the page corresponding to the Applies To class of the rule.

If this field is in a cell of a section that includes parameter declarations on the Parameters tab, you can enter the notation param.NAME here, to use a parameter value for the field, where NAME identifies a string parameter. Make sure that the NAME parameter is declared on the Parameters tab, and that your application provides a non-blank value for the parameter value in all possible situations where the section appears. See Sections — Completing the Parameter tab.

For a harness, the property generally must be on the primary page of the rule — the page corresponding to the Applies To key part of the rule. However, a section within the harness may have a different Applies To class, and that section can include properties from its own class.

If this field is always displayed as read-only, you can enter a linked property reference here, of the form .AAAA.BBBB, where AAAA is the linked property and BBBB is any property reference in the object identified by the value of AAAA as a key. For example, if the property AAAA has a value corresponding to a key of a Data-Admin-Operator-ID instance, then .AAAA.pyUserName presents that Operator ID's full name. This allows values from that object to appear (read-only) in the run-time display, though your processing does not explicitly load the object onto the clipboard.

Control

Accept the default pxDateTime control. When placed in a SmartLayout field, the adjoining Label cell is populated by the standard .pyTemplateCalendar property with a label value of Date Time. When placed in a repeating grid, the value appears above the control in the header cell.

Click (magnifying glass) to review the control identified in this field.

Customizing the control

The control's default parameters are the ones you'll most likely use in your UI design. If you wish, you can customize the control within the context of the section that contains it. For example, you can:

  • Display the control so that the user can pick dates and times from a calendar or from drop-down lists
  • Enable the user to manually enter date and time values
  • Select the date and time format
  • Add behaviors and actions, such as on Change, Refresh Section, Set Value, Post Value, or Set Focus. You can specify multiple actions for a single control. The actions execute in sequence. See Control Form — Completing the Control tab for descriptions of the available parameters and how to define behaviors.

Your edits apply only to the control within the section that contains it and do not update the underlying rule. You an add multiple controls of the same type within a section, each with its own custom settings.

Do the following to customize an auto-generated control in a section:

  1. Open the section or harness that contains the rule.
  2. Select the cell containing the rule and open its Cell Properties panel.
  3. In the panel, select the gear icon next to the Control field. This displays the control Parameters dialog. See Control Form — Completing the Control tab for descriptions of the available parameters and how to define behaviors.
  4. Modify as necessary.You cannot edit the Control Modes and UI Element settings.
    To immediately render your changes, click OK in the dialog. If satisfactory, save the section. The system generates the XML representing your edits and stores it in the section.
Behavior

Displays only if dynamic behavior for this control was configured before PRPC Version 6.3. In PRPC Version 6.3 and later, click the gear icon next to the Control field to configure dynamic behavior.

To modify an existing dynamic form action based on user updates or values for this field, click the gear icon next to the Behavior field to open the Client Event Editor. Complete the Client Event Editor to select an event (OnBlur, OnChange, or OnClick) and the resulting form action.

Click the help icon ( Help) on the Client Event Editor for assistance. For general information on this capability, see Harness and Section forms Help — Client Event Editor.

Client event support is not available for harnesses, sections, or flow actions that use directives.

3. Complete the Cell properties panel — General tab

Complete the General tab.

For descriptions of the fields and options in this tab, see Adding a Text Input control — Complete the Cell Properties Panel — General tab.

4. Complete the Cell properties panel — Advanced tab

Complete the Advanced tab.

For descriptions of the fields and options in this tab, see Adding a Text Input control — Complete the Cell Properties Panel — Advanced tab.

Copying, deleting, duplicating, or moving a Calendar field

Use these Windows operations to speed development:

About Flow Actions

About Harnesses

About Sections