Create Event Definition (CRTEVTDFN)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Create Event Definition (CRTEVTDFN) command defines a Java event and its attributes. An event could be a double-click or a right-click to a pop-up menu.

All optional parameters are controlled by the event type (EVTTYPE) parameter. To prompt the correct parameters, first specify the EVTTYPE then press enter.

Premised that iWeb converts 5250 application into Java objects. The concept of this CL command, part of a set of CL commands, is to interface Java Objects (and their properties and events) with RPG programs. The advantages of using CL commands are in the fact that they have parameters which can accept variables or expressions. For instance: One can create a "Button" which can call a host program using a variable which could be any field currently on the screen. Another example is the simplicity of showing an article's picture using, to define the path of the image, the expression ' ''/directory/articles/picture/'' *cat &FLD01 *tcat ''.gif'' ' where &FLD01 is a field (visible or hidden) within a subfile. Any customizations or enhancement are retained after a DDS or RPG application is recompiled because iWeb uses cascading XML documents to define styles and functions. The root is the original display, any sublevel XML are customizations. All customization or widget development can be defined for specific user, group, or languages. One can create a multi-language version of the application without touching the original RPG or DDS, or a specific layout can be defined for specific LOGIN user or one can specify that any fields such as COST% are hidden for a group of user. All this and much more just by using just the iWeb CL commands.

See also related commands.

Top

Parameters

Keyword Description Choices Notes
EVT Event Qualified object name Required, Positional 1
Qualifier 1: Event Name, *DDSSRC
Qualifier 2: Collection Name, DEFAULT
EVTTYPE Event type ONDOUBLECLICK, ONRIGHTCLICK Required, Positional 2
TEXT 'Description' text Character value, *BLANK Optional, Positional 3
ACTION Action SYSCMD, LINK, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ENTER, *NONE Optional, Positional 4
SYSCMD System command or expression Character value Optional, Positional 5
HREF Href link or expression Character value Optional, Positional 6
EVAL Evaluate field(s) expression Values (up to 100 repetitions): Element list Optional, Positional 7
Element 1: [Formatname.]Field name Character value, *NONE, '&THIS', *CLIENTFLD
Element 2: Eval value expression Character value, *NONE, '&THIS'
POPMENU Pop menu option(s) Values (up to 50 repetitions): Element list Optional, Positional 8
Element 1: Image path or expression Character value, *NONE
Element 2: 'Label' text Character value, *NONE
Element 3: Action SYSCMD, LINK, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ENTER, *NONE
Element 4: System command or expression Character value, *NONE
Element 5: Href link or expression Character value, *NONE
Element 6: Evaluate field expression Element list
Element 1: [Formatname.]Field name Character value, *NONE, '&THIS', *CLIENTFLD
Element 2: Eval value expression Character value, *NONE, '&THIS'
Top

Event (EVT)

Specifies the event you want to define.

This is a required parameter.

Qualifier 1: Event

*DDSSRC
*DDSSRC can be used only when the cmd is specified within a DDS source. To specify this cmd within a DDS source you have to use the following format, in complement of the cmd statement ADDEVTCNT:

     A          R FMT1
     A . . .
      *%%WBIW CRTEVTDFN EVT(*DDSSRC)
      *%%WBIW        EVTTYPE(...)
      *%%WBIW        . . .
      *%%WBIW ADDEVTCNT EVT(*DDSSRC)
      *%%WBIW        TOLEVEL(*DDSSRC)
     A . . .

The parameter value *DDSSRC assume the format or field name preceding the command insertion, like does any DDS keyword.

Nota: To insert the cmd within a DDS source, type-in the cmd in another session, use F14=cmd string and then do a copy/past to the DDS source.

name
Specify the name of the event you want to define.

Qualifier 2: Collection

DEFAULT
The collection named DEFAULT is used. (Collections are event's containers.)
name
Specify the name of the collection which contain the event you want to define.

Nota: To define new COLLECTION use the cmd: IWEB/CRTCLC

Top

Event type (EVTTYPE)

Specifies the event's type you want to define.

Nota: The command will prompt a different set of parameters according to the type of event you select. Any other parameters will be ignored.

This is a required parameter.

ONDOUBLECLICK
Mouse double-click event. Can be connected at *FIELD level.
ONRIGHTCLICK
Mouse right-click event, pop-up a contextual menu. Can be connected at *FIELD level.
Top

'Description' text (TEXT)

Specifies the text description of the event you define.

*BLANK
No text is specified.
character-value
Specify the text description.
Top

Action (ACTION)

Specifies the action of the event. This is the action returned to the host program.

This parameter is controlled by the event type (EVTTYPE): ONDOUBLECLICK

SYSCMD
Execute a system command on the host iSeries. (By choosing this value you have to enter also the SYSCMD parameter).
LINK
Link to a URL. (By choosing this value you have to enter also the HREF parameter).
F01-F24
Simulate the press function key F01-F24.
ENTER
Simulate the press Enter.
*NONE
No action or returned to the host program.
Top

System command (SYSCMD)

Specifies the system command that will be executed. This command could be any CL command.

This parameter is controlled by the event type (EVTTYPE): ONDOUBLECLICK Approach to the Object Oriented Programming (OOP).

character-value
Specify the system command as a string or an expression.
Top

Href link or expression (HREF)

Specifies the Hypertext Reference of a link.

This parameter is controlled by the event type (EVTTYPE): ONDOUBLECLICK

All HREF protocols are usable, for instance:

character-value
Specify the Hypertext Reference as a string or an expression.
Top

Evaluate field(s) expression (EVAL)

Specifies the expression value of a field. Approach to the Object Oriented Programming (OOP).

This parameter is controlled by the event type (EVTTYPE): ONDOUBLECLICK

You can specify 100 values for this parameter.

Element 1: Field name

variable-name
Specify a display field name. (It could from any usage of: I, O, B, or H) When the field is coming from another format than the connected one you can specify it as a prefix followed with a coma '.': FormatName.FieldName

Example you may use:

  • EVAL((FLD1 A10)) <=> eval FLD1=A10
  • EVAL(('&FLD1' '&A10')) <=> eval FLD1=A10
  • EVAL((FLD1 'abc')) <=> eval FLD1='abc'
  • EVAL((FORMAT2.FLDB A10)) <=> eval FLDB=A10 (FLDB from format FORMAT2)
  • EVAL(('*CLIENTFLD' A10)) <=> move the value A10 into a invocation field

Element 2: Eval value expression

character-value
Specify the field value as a string or an expression.
Top

Pop menu option(s) (POPMENU)

Specifies the pop-menu items of the right-click event.

This parameter is controlled by the event type (EVTTYPE): ONRIGHTCLICK

You can specify 50 values for this parameter.

Element 1: Image path or expression

*NONE
No image icon are used for the menu-item.
character-value

Specifies the adress of the image for the icon-item.

Element 2: 'Label' text

*NONE
No label are used for the menu-item.
character-value
Specify the label of the menu-item.

Nota: You can define multi-level menu using the separatore "/" within the item label. "links/link1" will create 2 pop-up menu, the first will show "link >" and the second will show "link1". If you create 2 label's item "links/link1" and "link/link2" the first pop-up menu will group the label "link >" and the second level pop-up menu will show link2 and link2.

Element 3: Action

SYSCMD
Execute a host system command (provided by the element SYSCMD)
LINK
Execute a link (provided by the element HREF)
F01-F24
Execute the Function Key F01-F24.
*NONE
No action are executed.

Element 4: System command or expression

*NONE
No system command are executed.
character-value
Specify the system command as a string or an expression.

Element 5: Href link or expression

*NONE
No link are used.
character-value
Specify the Hypertext Reference as a string or an expression.

Element 6: Evaluate field expression

Element 1: [Formatname.]Field name

*NONE
No field values are changed.
'&THIS'
The current field (of the right-click) is the field of the eval.
*CLIENTFLD
Approach to the Object Oriented Programming (OOP).
character-value
Specify the expression value of a field.

Element 2: Eval value expression

*NONE
No values.
'&THIS'
The current field (of the right-click) is the field of the eval.
character-value
Specify the value for the field.
Top

Examples for CRTEVTDFN

Example 1: Create a double-click event

CRTEVTDFN EVT(MYCLCL/MYDBLCLICK)
          EVTTYPE(ONDOUBLECLICK)
          TEXT('on double click')
          ACTION(LINK)
          HREF(WWW.GOOGLE.COM)

This command creates a double-click event, named MYDBLCLICK within the collection named MYCLC. The double-click will open a new window with the link www.google.com

Top

Error messages

Unknown
Top