DATEINPUT2

#### Search Results

Search

# DATEINPUT2

The DATEINPUT2 control supports the selection and input of a date from a calendar. It has a more modern look and feel than the DATEINPUT control and does not require browser pop-ups.

The following topics are covered below:

- Customizing Date and Calendar Formats

- DATEINPUT2 – Custom Dates

- Properties

## Customizing Date and Calendar Formats

Default behavior for the date and calendar formats for NATPAGE layouts:

- Date format in browser:
  Per default the dates are shown in the browser according to the Natural DTFORM parameter.

- Date format in Natural program:
  Depending on the `datatype` property the Natural type D or an (A/U) DYNAMIC type is used. For the latter the format on the server is YYYYMMDD.

- Calendar format:
  The first day in week of the calendar is per default Sunday and can be customized per application and per single page at runtime by using the NJX:SESSIONPARAMS control

Some use cases require the formats to be customized independently of the central format at design time and in a more flexible way. This is supported by the properties `clientformat`, `severformat`, and `firstdayinweek`. If these properties are set in a control, they will overwrite the default behavior. For the `clientformat` and the `serverformat` property a subset of the Natural date edit masks is supported:

Character | Usage
--- | ---
DD | Day
ZD | Day with zero suppression
MM | Month
ZM | Month with zero suppression
YYYY | Year, 4 digits
YY | Year, 2 digits

## DATEINPUT2 – Custom Dates

Per default, the DATEINPUT2 control validates inserted dates according to a range of valid dates. Inserting dates outside of this range are not accepted by the user interface. Sometimes applications use predefined date values to reflect an application-specific semantic meaning. Example: An application may use the date “9999-99-99” to express a never expiring license. For these applications, an end-user must be able to enter these specific custom dates without getting validation errors.

This is supported for DATEINPUT2 controls for which a `clientformat` is set. The custom dates can be specified as the configuration setting `customdates` in the cisconfig.xml configuration file.

Example:

    <cisconfig customdates=”99999999;99991231” ….></cisconfig>

In the `customdates` property, you can specify several `customdates` separated by a semi-colon. The format for these custom dates is `YYYYMMDD`. When a custom date is entered in the browser no validation error is displayed. They are rendered according to the `clientformat` property value and passed to the server according to the `serverformat` property value if specified.

Example:

    <dateinput2 clientformat=”YYYY-MM-DD” serverformat=“DD/MM/YYYY“…>

Typing „99999999“ in the browser will be rendered as “9999-99-99” and sent to the server as “99/99/9999”.

For custom dates, the calendar widget is not available. It appears again once the custom date is removed or changed to a “normal date”.

## Properties

Basic
valueprop | Name of the adapter parameter that provides the content of the control. | Optional |
width | Width of the control. There are three possibilities to define the width: (A) You do not define a width at all. In this case the width of the control will either be a default width or - in case of container controls - it will follow the width that is occupied by its content. (B) Pixel sizing: just input a number value (e.g. "100"). (C) Percentage sizing: input a percentage value (e.g. "50%"). Pay attention: percentage sizing will only bring up correct results if the parent element of the control properly defines a width this control can reference. If you specify this control to have a width of 50% then the parent element (e.g. an ITR-row) may itself define a width of "100%". If the parent element does not specify a width then the rendering result may not represent what you expect. | Optional | 100 120 140 160 180 200 50% 100%
datatype | By default, the DATEINPUT control is managing a day. By explicitly setting a datatype you can define that the control is managing a day and time. In the first use type CDATE within your adapter program - in the second case use type CTIMESTAMP. | Optional | date datetime ------------------------ xs:date xs:dateTime
serverformat | For alphanumeric datatypes you can choose the format of the date at design time. Examples: YYYY-MM-DD, DD.MM.YY, YY/MM/DD. A subset of the Natural date edit masks is supported. The serverforma is the format in which the data is sent to Natural. | Optional | YYYY-MM-DD DD/MM/YYYY MM-DD-YY
clientformat | You can choose the format of the date in the browser at design time. Examples: YYYY-MM-DD, DD.MM.YY, YY/MM/DD. A subset of the Natural date edit masks is supported. If set the Natural DTFORM parameter will not be used. This setting is only for the rendering in the client. It is independent of the set datatype. | Optional | YYYY-MM-DD DD/MM/YYYY MM-DD-YY
firstdayinweek | You can set the first day in week at design time. Valid values are SU - for Sunday - and MO - for Monday. If set the value set by the NJX:SESSIONPARAMS control will not be used. | Optional | SU MO
comment | Comment without any effect on rendering and behaviour. The comment is shown in the layout editor's tree view. | Optional |
Binding
valueprop | (already explained above) |  |
fromprop | Name of the adapter parameter that provides a lower limit for the value of the control. The value is used for client side validation of user input. | Optional |
toprop | Name of the adapter parameter that provides an upper limit for the value of the control. The value is used for client side validation of user input. | Optional |
displayprop | Name of the adapter parameter that dynamically passes information whether the field is displayonly("true") or not ("false"). Notice that in the Natural code the type for the field is alphanumeric. | Optional |
statusprop | Name of the adapter parameter that dynamically passes information how the control should be rendered and how it should act. Valid parameter values at runtime: "INVISIBLE", "FOCUS", "FOCUS_NO_SELECT", "ERROR", "ERROR_NO_FOCUS". In responsive controls additionally the values "WARNING" and "SUCCESS" are supported. The value "INVISIBLE" is only supported if the control does not support an INVISIBLEPROP. Use DISPLAYPROP or VISIBLEPROP if available to render the control displayonly/invisible/cleared. | Optional |
flush | Flushing behaviour of the input control. By default an input into the control is registered within the browser client - and communicated to the server adapter object when a user e.g. presses a button. By using the FLUSH property you can change this behaviour. Setting FLUSH to "server" means that directly after changing the input a synchronization with the server adapter is triggered. As consequence you directly can react inside your adapter logic onto the change of the corresponding value. - Please be aware of that during the synchronization always all changed properties - also the ones that were changed before - are transferred to the adapter object, not only the one that triggered the synchonization. Setting FLUSH to "screen" means that the changed value is populated inside the page. You use this option if you have redundant usage of the same property inside one page and if you want to pass one changed value to all its representation directly after changing the value. | Optional | screen server
flushmethod | When the data synchronization of the control is set to FLUSH="server" then you can specify an explicit event to be sent when the user updates the content of the control. By doing so you can distinguish on the server side from which control the flush of data was triggered. | Optional |
holidaysurlprop | Name of the Adapter paramter which provides the URL for a json file with custom holidays dynamically at runtime. | Optional |
Appearance
popupicon | URL of image that is displayed inside the right corner of the field to indicate to the user that there is some value help available.. Any image type (.gif, .jpg, ...) that your browser does understand is valid. Use the following options to specify the URL: (A) Define the URL relative to your page. Your page is generated directly into your project's folder. specifying "images/xyz.gif" will point into a directory parallel to your page. Specifying "../HTMLBasedGUI/images/new.gif" will point to an image of a neighbour project. (B) Define a complete URL, like "http://www.softwareag.com/images/logo.gif". | Optional | gif jpg jpeg
popuponalt40 | Value help in a field is triggered either by clicking with the mouse or by pressing a certain key inside the field. The "traditional" keys are "cursor-down", "F7" or "F4". Sometimes you do not want to mix other "cursor-down" behaviour (e.g. scrolling in lists) with the value help behaviour. In this case switch this property to "true" - and the value help will only come up anymore when "alt-cursor-down" is pressed. | Optional | true false
popuponF4F7 | Per default the calendar is opened on F4 and F7. Set this property to false if you want to use F4 or F7 for other purpose. | Optional | true false
invisiblemode | If the visibility of the control is determined dynamically by an adapter property then there are two rendering modes if the visibility is "false": (1) "invisible": the control is not visible. (2)"cleared": the control is not visible but it still occupies space. | Optional | invisible cleared
displayonly | If set to true, the FIELD will not be accessible for input. It is just used as an output field. | Optional | true false
numberofmonths | Number of months shown for selection. Default is 1 | Optional |
align | Horizontal alignment of control in its column. Each control is "packaged" into a column. The column itself is part of a row (e.g. ITR or TR). Sometimes the size of the column is bigger than the size of the control itself. In this case the "align" property specifies the position of the control inside the column. In most cases you do not require the align control to be explicitly defined because the size of the column around the controls exactly is sized in the same way as the contained control. If you want to directly control the alignment of text: in most text based controls there is an explicit property "textalign" in which you align the control's contained text. | Optional | left center right
valign | Vertical alignment of control in its column. Each control is "packaged" into a column. The column itself is part of a row (e.g. ITR or TR). Sometimes the size of the column is bigger than the size of the control. In this case the "align" property specify the position of the control inside the column. | Optional | top middle bottom
inputstyle | CSS style definition that is directly passed into this control. With the style you can individually influence the rendering of the control. You can specify any style sheet expressions. Examples are: border: 1px solid #FF0000 background-color: #808080 You can combine expressions by appending and separating them with a semicolon. Sometimes it is useful to have a look into the generated HTML code in order to know where direct style definitions are applied. Press right mouse-button in your browser and select the "View source" or "View frame's source" function. | Optional | background-color: #FF0000 color: #0000FF font-weight: bold
stylevariant | Some controls offer the possibility to define style variants. By this style variant you can address different styles inside your style sheet definition file (.css). If not defined "normal" styles are chosen, if defined (e.g. "VAR1") then other style definitions (xxxVAR1xxx) are chosen. Purpose: you can set up style variants in the style sheet definition and use them multiple times by addressing them via the "stylevariant" property. CIS currently offers two variants "VAR1" and "VAR2" but does not predefine any semantics behind - this is up to you! | Optional | VAR1 VAR2
rowspan | Row spanning of control. If you use TR table rows then you may sometimes want to control the number of rows your control occupies. By default it is "1" - but you may want to define the control to span over more than one columns. The property only makes sense in table rows that are synchronized within one container (i.e. TR, STR table rows). It does not make sense in ITR rows, because these rows are explicitly not synched. | Optional | 1 2 3 4 5 50 int-value
colspan | Column spanning of control. If you use TR table rows then you may sometimes want to control the number of columns your control occupies. By default it is "1" - but you may want to define the control to span over more than one columns. The property only makes sense in table rows that are synchronized within one container (i.e. TR, STR table rows). It does not make sense in ITR rows, because these rows are explicitly not synched. | Optional | 1 2 3 4 5 50 int-value
noborder | Boolean value defining if the control has a border. Default is "false". | Optional | true false
transparentbackground | Boolean value defining if the control is rendered with a transparent background. Default is "false". | Optional | true false
tabindex | Index that defines the tab order of the control. Controls are selected in increasing index order and in source order to resolve duplicates. | Optional | -1 0 1 2 5 10 32767
holidaysurl | URL for json file, which contains custom holidays. | Optional |
holidaysstyleclass | Name of the css style class, which is used for the rendering of custom holidays. Default is DATEINPUT2Holidays | Optional |
holidaysdescriptionastooltip | Set this property to true if you want to show descriptions in the json file as tool tips. | Optional | true false
Online Help
title | Text that is shown as tooltip for the control. Either specify the text "hard" by using this TITLE property - or use the TITLETEXTID in order to define a language dependent literal. | Optional |
titletextid | Text ID that is passed to the multi language management - representing the tooltip text that is used for the control. | Optional |
titleprop | Name of the adapter parameter that dynamically defines the title of the control. The title is displayed as tool tip when ther user moves the mouse onto the control. | Optional |
placeholder | The text for the HTML placeholder attribute. The placeholder attribute specifies a short hint that describes the expected value. | Optional |
helpid | Help id that is passed to the online help management in case the user presses F1 on the control. | Optional |
Natural
njx:natname | If a Natural variable with a name not valid for Application Designer (for instance #FIELD1) shall be bound to the control, a different name (for instance HFIELD1) can be bound instead. If the original name (in this case #FIELD1) is then specified in this attribute, the original name is generated into the parameter data area of the Natural adapter and a mapping between the two names is generated into the PROCESS PAGE statement of the Natural adapter. This mapping must not break a once defined group structure. If for instance a grid control that is bound to a name of GRID1 contains fields that are bound to FIELD1 and FIELD2 respectively, the corresponding njx:natname values may be #GRID1.#FIELD1 and #GRID1.#FIELD2, but not #GRID1.#FIELD1 and #MYGRID1.#FIELD2. | Optional |
njx:natsysvar | If the control shall be bound to a Natural system variable, this attribute specifies the name of the system variable. | Optional |
njx:natsysio | If the control shall be bound to a Natural system variable with the attribute njx:natsysvar, this attribute indicates if the system variable is modifiable. The default is false. | Optional |
njx:natstringtype | If the control shall be bound to a Natural system variable of string format with the attribute njx:natsysvar, this attribute indicates the format of the string, A (code page) or U (Unicode). The default is A. | Optional |
njx:natcv | Name of a Natural control variable that shall be assigned to the control. | Optional |
njx:natcomment | The value of this attribute is generated as comment line into the parameter data area of the Natural adapter, before the field name. The Map Converter, for instance, uses this attributes to indicate a generated statusprop variable to which field the statusprop belongs. | Optional |
Miscellaneous
testtoolid | Use this attribute to assign a fixed control identifier that can be later on used within your test tool in order to do the object identification | Optional |

### On this page

- Customizing Date and Calendar Formats
- DATEINPUT2 – Custom Dates
- Properties