published by Yannick on 8 June, 2011 - 10:49
It often happens that you want to execute an operation added in the bindings. This is often the case with business components. You want to commit a transaction, create a new row and so on. All these operations can be added in the opertion bindings.
The snippet below shows you how to execute these operations from a managed bean.
Snippet:
private void executeOperation(String method){
BindingContainer bindings =
BindingContext.getCurrent().getCurrentBindingsEntry();
OperationBinding operationBinding =
bindings.getOperationBinding(method);
operationBinding.execute();
}
Example:
This example shows you how you can use the snippet to execute the rollback or commit depending on the outcome of a dialog:
public void dialogListener(DialogEvent e) {
if(e.getOutcome() != DialogEvent.Outcome.no)
{
executeOperation("Commit");
}
else
{
executeOperation("Rollback");
}
Comments
awesome tutorial
Excellent site to learn for webcenter portal.Really love it.
Add new comment