A script-enabled browser is required for this page to function properly.

When-Custom-Item-Event Trigger

Description

Fires whenever a JavaBean 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_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 JavaBeans Example 

This is an example of a procedure called by a When-Custom-Item-Event trigger in a form that uses two JavaBeans.

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.

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;