You can add a calendar icon to a page with the DatePicker element. The user can click this icon to select a calendar date and populate a page field. For example, the Waveset Create Audit Report page uses this component to select start and end dates.
The DatePicker element returns a date object. Most resource attributes that you set using DatePicker require a date in the form of a string. The extra text field performs the conversion of the new date object into a string or displays the current setting.
You can obtain the date in one of several formats by passing a different format string to the invoke dateToString method as indicated in the following table.
Table 2–14 Expiration Date Formats|
Expiration Date Field |
Format |
|---|---|
|
AIX |
MMddHHmmyy |
|
HPUX |
MM/dd/yy |
|
Solaris |
MM/dd/yyyy |
<Field name=’aix_account_expire’>
<Display class=’DatePicker’>
<Property name=’title’ value=’Set Password Expiration Date’/>
</Display>
</Field>
The field defined below displays the password expiration date as found in the /etc/security/user file. It also displays any new date selected by the aix_account_expire field if the refresh or recalculate is performed after selecting a new date. Waveset looks to see if the aix_account_expire date field has been set (not null) from the DatePicker field.
If this date field has been set, Waveset calls an invoke method to convert the date object into a string in the specified format: MMddHHmmyy.
Otherwise, display the current date as set on the AIX OS: accounts[AIX].aix_expires.
<Field name=’accounts[AIX].aix_expires’>
<Display class=’Text’>
<Property name=’title’ value=’Current Password Expiration Date’/>
<Property name=’noNewRow’ value=’true’/>
<Property name=’readOnly’ value=’true’/>
<Property name=’size’ value=’10’/>
</Display>
<Expansion>
<cond>
<notnull>
<ref>aix_account_expire</ref>
</notnull>
<invoke name=’dateToString’ class=’com.waveset.util.Util’>
<!-- First argument to dateToString method is a date object -->
<ref>aix_account_expire</ref>
<!-- Second argument is the format you want the converted date/string in -->
<s>MMddHHmmyy</s>
</invoke>
<ref>accounts[AIX].aix_expires</ref>
</cond>
</Expansion>
</Field>
|