Tuesday, December 8, 2015

Implementing Component Reference in ADF

There is a lot of confusion about how to use ADFcomponent binding in managed beans in a clustered environment to meet high availability.
UI Components are not serializable in ADF, so your application might fail to work correctly in a clustered environment.
So we need to implement Component Reference in backing beans .
This will be useful only in case of managed bean which is in a scope greater than requestScope or backingBeanScope.

Actual Backing Bean Bindings
-----------------------------------------------
    private RichCommandLink commandButton;

    public void setPagiCommand(RichCommandLink commandButton) {
        this.commandButton= commandButton;
    }

    public RichCommandLink getCommandButton() {
      
        return commandButton;
    }

ComponentReference Implementation
-----------------------------------------------
    private ComponentReference commandButton;


    public void setPagiCommand(RichCommandLink commandButton) {
        this.commandButton = ComponentReference.newUIComponentReference(commandButton);
    }

    public RichCommandLink getCommandButton() {
        if(commandButton!=null)
            return (RichCommandLink)commandButton.getComponent();
        return null;
    }

Thursday, July 9, 2015

Programatically Calling Hidden Button Action

If you want to call a hidden button action from another button action/event use below code

private void navigateByQueueAction() {
   FacesContext fctx = FacesContext.getCurrentInstance();
   UIViewRoot root = fctx.getViewRoot();
   //client Id of button includes naming container like id of region. 
   RichCommandButton button = 
           (RichCommandButton) root.findComponent("r1:cb3");
   ActionEvent actionEvent = new ActionEvent(button);
   actionEvent.queue();
}

Wednesday, May 14, 2014

oracle.stellent.ridc.protocol.ServiceException: Unable to retrieve search results. Unable to parse date

ISSUE:
oracle.stellent.ridc.protocol.ServiceException: Unable to retrieve search results. Unable to parse date '10/11/11 12:00 AM'.
     at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:135)
     at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:107)

Solution:
 
To resolve this issue we have to change date format to yyyy-MM-dd hh:mm:ss

 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String lastModifiedFromDate=sdf.format(lastDate);
            if (lastModifiedFromDate!= null) {
                if ("".equalsIgnoreCase(queryString))
                    queryString= queryString+ "xmodifiedDate>=`" + lastModifiedFromDate + "`";
                else
                    queryString =queryString + "<AND>" + "xmodifiedDate>=`" + lastModifiedFromDate +"`";
            }

Thursday, November 28, 2013

Tuesday, October 22, 2013

Uploading Large Files from ADF 11g Applications

In ADF upload component if we want to increase upload file size we have to keep below code in web.xml.

<context-param>
    <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE</param-name>
    <param-value>20971520</param-value>
  </context-param>

if we set adf instead of apache that use to throw "The file could not be uploaded because it is too large" error on upload component.