P. 1
Form Codes

Form Codes

|Views: 2,325|Likes:
Published by javeed007

More info:

Published by: javeed007 on Feb 23, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/20/2012

pdf

text

original

Description

Fires whenever a JavaBean or ActiveX (on 32-bit Windows) or VBX (on 16-bit Microsoft Windows
3.x) custom component in the form causes the occurrence of an event.

Definition Level:

form, block, item

Legal Commands:

unrestricted built-ins, restricted built-ins

Enter Query Mode:

yes

Usage Notes

Use a When-Custom-Item-Event trigger to respond to a selection or change of value of a custom
component. The system variable SYSTEM.CUSTOM_ITEM_EVENT stores the name of the event
that occurred, and the system variable SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS stores a
parameter name that contains the supplementary arguments for an event that is fired by a custom
control.

Control event names are case sensitive.

On Failure:

no effect

When-Custom-Item-Event trigger examples

JavaBeans Example

This is an example of a procedure called by a When-Custom-Item-Event trigger in a form that uses two
JavaBeans. (For the context, see the complete example.)

The trigger is fired by the dispatching of a custom event in one of the JavaBeans, in response to a
change in value.

CustomEvent ce = new CustomEvent(mHandler, VALUECHANGED);

dispatchCustomEvent(ce);

In the form, the When_Custom_Item_Event trigger that is attached to this JavaBean’s Bean Area item
is automatically fired in response to that custom event.

508

In the trigger code, it executes the following procedure. Note that this procedure picks up the new
values set in the JavaBean container (a new animation rate, for example) by accessing the
System.Custom_Item_Event_Parameters.

In this example, the procedure then uses the Set_Custom_Item_Property built-in to pass those values to
the other JavaBean.

PROCEDURE Slider_Event_Trap IS

BeanHdl Item;

BeanValListHdl ParamList;

paramType Number;

EventName VarChar2(20);

CurrentValue Number(4);

NewAnimationRate Number(4);

Begin

-- Update data items and Display fields with current radius

information

BeanValListHdl :=
get_parameter_list(:SYSTEM.Custom_Item_Event_Parameters);

EventName := :SYSTEM.Custom_Item_Event;

:event_name := EventName;

if (EventName = 'ValueChanged') then

get_parameter_attr(BeanValListHdl,'Value',ParamType,

CurrentValue);

NewAnimationRate := (300 - CurrentValue);

:Animation_Rate := NewAnimationRate;

set_custom_item_property('Juggler_Bean','SetAnimationRate',

NewAnimationRate);

elsif (EventName = 'mouseReleased') then

get_parameter_attr(BeanValListHdl,'Value',ParamType,

CurrentValue);

set_custom_item_property('Juggler_Bean','SetAnimationRate',

CurrentValue);

end if;

End;

VBX Example

This is an example of a procedure that can be called when Form Builder fires the When-Custom-Item-
Event trigger.

DECLARE
TabEvent varchar2(80);
TabNumber Number;

BEGIN

TabEvent := :system.custom_item_event;
/*
** After detecting a Click event, identify the
** tab selected, and use the user-defined Goto_Tab_Page
** procedure to navigate to the selected page.
*/
IF (UPPER(TabEvent) = 'CLICK') THEN

509

TabNumber := VBX.Get_Property('TABCONTROL','CurrTab');
Goto_Tab_Page(TabNumber);
END IF;
END;

510

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->