Showing posts with label container. Show all posts
Showing posts with label container. Show all posts

Thursday, 21 February 2013

ADF: Code to get bindings to make custom buttons

## Code to get bindings to make custom buttons

1)Use in the code.

BindingContainer bindings = getBindings();
OperationBinding operationBinding =bindings.getOperationBinding("Commit");
operationBinding.execute();


2)Definetion of getBindings method


public BindingContainer getBindings() {
return BindingContext.getCurrent().getCurrentBindingsEntry();
}

OR

** We can use directly in one line**

BindingContext.getCurrent().getCurrentBindingsEntry().
getOperationBinding("CreateInsert")
.execute();

_______________________________________________________________________________
If you have any Questions about ADF. Feel free to ask. I will be happpy to help. :)


ADF: Popup Dialauge listener


## ADF: Popup Dialauge listener

public void dailogok(DialogEvent dialogEvent) {
   
    if(dialogEvent.getOutcome().name().equals("ok")){
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding =bindings.getOperationBinding("Commit");
        operationBinding.execute();
    }

ADF: Show inline messege

## ADF: Show inline messege

public void showMessageButton(ActionEvent actionEvent) {
FacesMessage msg=new FacesMessage("This is a FacesMessage that+
"shows Fatal Error --JavaCup");
msg.setSeverity(FacesMessage.SEVERITY_FATAL);
FacesContext fctx=FacesContext.getCurrentInstance();
fctx.addMessage(null, msg);
}