Feeds:
Posts
Comments

Archive for the ‘Uncategorized’ Category

You might face a problem in your ADF application, when based on a HumanTask component (BPM), using the out of the box Comments & Attachemnts.

Well…suddenly it’s not working anymore…you press the add attachmen/comment button, and nothing happen.

So, obviously you first need to verify that the user has the right permission for that action. Once it is clear, check that the following declaration exists in your .jspx page:

comments-and-attachments

Bug or not…it can sometimes disappear and might driving you crazy.

Good Luck

Read Full Post »

I’m getting many questions regarding to how can we control components base on other components.

One of the standards ways is to use the object’s properties and EL expression.
So, this is something very basic in ADF and I think it’s important to understand and know.

Many of the ADF faces component have 2 important properties: AutoSubmit and PartialTriggers.
Basically what they are saying:

  1. AutoSubmit: when it is set to true, you are partially submitting an action. For example, changing the value of an inputText.
    When the value is being changed, there is no need to wait for a refresh or a global update.
    That way you can control a specific objects in your page.
  2. PartialTriggers: in this property you are referring to the previous input text.
    If you want the current object to fire an action, based on another object (like inputText changing value), you need to set the partialTriggers value to the id of that component.

 

Here is a simple example: You have 2 inputtext, A & B. B is disable, until a value will be enter in A. For that we will use only EL expression:

 

autosubmit

 

id

partialtrigger

 

Good Luck

Read Full Post »

In this post I will explain, how in a simple way you can use managed bean to perform a binding operation.
In case of using ADF for managing Human Task flows (BPM process), you sometimes want to perform post/pre actions to the native operation.
For example: you want the user to press the approve action, and in the background you want to call a Web service for some validations.
Here is how you do it:

  1. Create a bean method by double click the action button, or manually create a class with the required method:beanto copy:
     
    public String approveAction() {
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding validateNameOP = bindings.getOperationBinding("validateName");
    Object resultCommit = validateNameOP.execute();
    if (!validateNameOP.getErrors().isEmpty()) {
    return null;
    }
    
    AttributeBinding status =(AttributeBinding)bindings.get("status");
    if (status.getInputValue().toString().equalsIgnoreCase("Y")){
    OperationBinding operationBinding = bindings.getOperationBinding("APPROVE");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    System.out.println("inside error");
    return null;
    }
    }else{
    return null;
    }
    return "refreshTaskFlow";
    
  2. Declare the bean in the action listener property of the command button:approve-button

That’s it.

Just be sure, that both APPROVE & validateName operations are declared in the binding. Or else you will get nullPointerException.

Good Luck

Read Full Post »

Here is a small example of a way to enable or disable a command button using a standard functionality of an ADF.
Take for example the next scenario: You want to reject a form, and you must enter a reject reason.

For that we will use a commandButton (for the reject action) and an inputText (for the reject reason).
Change both objects’ attributes as follows:

inputText:

  • Set the AutoSubmit property to ‘true’:

    AutoSubmit

CommandButton:

  • Set the PartialTriggers property to the Reject InputTextId Id:

    PartialTriggers

  • Set the Disabled property to have a condition base on the InputText value:
    In my example: #{empty bindings.RejectReason.inputValue}

    Reject Reason

 

Run the page and test it.

Good Luck!

Read Full Post »