tell me more icon Creating a Custom Drop Event Listener

To invoke custom code when a drop event is fired, register a drop event listener on the drop target component. The drop event listener is a method in a managed bean that contains your custom code for handling and processing the drop event. At runtime, when a source component is dragged and dropped on the target component, the drop event listener method is automatically invoked.

In this example, you will create a drop event listener method that adds a dropped value to a list of items in a listbox. You will also create a property and getter method to dynamically populate the listbox with an initial list of items. You will create the methods in a managed bean, which is added to the JSF configuration file faces-config.xml.

Note: If you are creating an application that also uses ADF data bindings and task flows, you should add managed beans to either the adfc-config.xml file or the task flow definition file.

To begin creating a custom drop event listener method, you will create and configure a managed bean using the overview editor for the faces-config.xml file. To open the overview editor, in the Application Navigator double-click faces-config.xml to open the file in the editor window, then click the Overview tab at the bottom of the editor.

Overview editor for faces-config.xml file

In the Managed Beans section of the overview editor, you will click add icon Add to use the Create Managed Bean dialog to let JDeveloper configure the managed bean in faces-config.xml, and create a new Java class file for you. You will specify a name, a Java class name, and select a scope for the managed bean in the dialog.

Create Managed Bean dialog

After creating and configuring a managed bean, you can immediately begin editing the class file in the source editor to add your method code.

Source editor of Java class file

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,