tell me more icon In the IDE

When you complete the steps for specifying a drop target with a data flavor, and registering the drop event listener on the drop target, the visual editor should look similar to this:

Visual editor

In the XML editor, the code for the select one listbox component looks like this:

                               
<af:selectOneListbox label="Beverage choices"..>
  <f:selectItems value="#{dnd.choices}"../>
  <af:dropTarget dropListener="#{dnd.handleItemDrop}">
    <af:dataFlavor flavorClass="java.lang.String"/>
  </af:dropTarget>
</af:selectOneListbox>
                            

When you run the page, the page in the browser should look similar to this:

Page in browser, before dropping

Drag the image and drop it over the list of beverage choices. As you drag the image over an acceptable drop area on the page, the component's background color changes. After you release the mouse button to drop the image onto the list, you should see the new item Coffee appended to the list of existing choices:

Page in browser, after dropping

Upon a successful drop action, the drop target rerenders by partial page rendering, thus you see the dropped value in the listbox.

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

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