Add Widget-level events

Widget-level events are the events that are triggered with respect to the widgets. To add a new Widget-level event to the newly created program c/custmord.p, we follow the steps below:

  • Click on the new button in the Event tab for the selected newly created program c/custmord.p.

    Adding widget level event for a widget
    Figure: Adding widget level event for a widget
  • Enter the widget name in the Widget. Here we have used v-testbtn in the widget field.

  • Select an event type from the Event field; here we select the event type as CHOOSE,

  • Enter a unique sequence no. in the Sequence field.

  • Type a procedure name in the Procedure field. Here we enter the procedure name p-testbtnClick.

  • In the Run field enter the file name which contains the business logic to be executed. It is within this file that the logic related to the event is written. We can use a single file for different event procedures. Here we enter the file name as c/custlord.p .
  • Select NO-APP in Appserver field.
  • Enter the character ‘*’ in the Frontend field, this denotes that the event runs in every environment.
  • Once the above steps are completed, click on the save
  • Next, click on the Editor Button, to write the business logic as required. Here is a short sample of a business logic code

procedure p-testbtnClick:
/*------------------------------------------------------------------------------
Field : v-testbtn
Event : CHOOSE

Description : Change the label of widget 'v-displaycontent'
Created : 16/12/15 Javra Software
------------------------------------------------------------------------------*/

p-result = "v-displaycontent" + chr(1) + "Label changed on click of button".

end procedure. /* p-testbtnClick */

  • Based on the above logic we have assigned a text “Label changed on click of button” to the Choose event of the button ‘v-testbtn’ named as Click Here
  • Now click save and Run the program.
  • When the program is executed, here is how it should appear on click of the Click Here Button
Widget level event added
Figure: Widget level event added

results matching ""

    No results matching ""