For a test/PoC I have replicated the showcase example (exactly) just using some of my own data. Which populates & displays in the DataTable.
However, when I drag an item to the 'Selected Pane' I get the error:
The XHTML that calls this is:SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (default task-1) javax.el.MethodNotFoundException: Method not found: class com.notifywell.controller.NOTiFYwellController.onIngredientDrop(org.primefaces.event.DragDropEvent)
Code: Select all
<p:droppable for="fieldsetSelectedIngredients" tolerance="touch" activeStyleClass="ui-state-highlight" datasource="dataTableAvailableIngredients" onDrop="handleDrop">
<p:ajax listener="#{nOTiFYwellController.onIngredientDrop}" update="dropArea dataTableAvailableIngredients" />
</p:droppable>
Code: Select all
<p:ajax listener="#{dndCarsView.onCarDrop}" update="dropArea availableCars" />
Code: Select all
@Model
@Path("/")
@ViewScoped // OmniFaces 3.1
@Named("nOTiFYwellController")
//@ManagedBean(name="nOTiFYwellController") // Deprecated
public class NOTiFYwellController implements Serializable {
.....
public void onIngredientDrop(DragDropEvent ddEvent) {
Ingredient ingredient = ((Ingredient) ddEvent.getData());
logger.info("***** onIngredientDrop ddEvent = {}", ddEvent.getData());
}
}
Code: Select all
public void onCarDrop(DragDropEvent ddEvent) {
Car car = ((Car) ddEvent.getData());
droppedCars.add(car);
cars.remove(car);
}
The error is due to the '<p:ajax listener' not passing the 'DragDropEvent' parameter.WELD-001303 No active contexts for scope type
In the PF ShowCase example, the parameter isn't required. How can I get the 'DragDropEvent' in my backing bean?
If I make the 'onIngredientDrop' method with no parameters it gets called and displays a (revised) log message.
TIA