Skip to content
May 23, 2012 / danilo

ADF Beginners

As a beginner in ADF development here are some pointers that will help you from an early stage:

Oracle Tutorials -> Step by step instructions through common tasks for application developers.

ADF Code Corner -> Works like a blog that provides hints and tips for ADF developers, each month a PDF is released with use cases developed from questions in Oracle ADF forum.

Oracle JDeveloper & Adf forum -> One of the most active forums on Oracle network, is the place to go when nothing else works.

Adf Insider -> Contains tips and techniques for building ADF applications, some more advanced topics are discussed here.

Here are some examples of useful java code for ADF applications, at first you may not understand what is AdfFacesContext or pageFlowScope but after going through the tutorials they will become familiar.


// Obtain value from pageFlowScope
public static Object getValueFromPageFlowScope(String variable) {
  return AdfFacesContext.getCurrentInstance().getPageFlowScope().get(variable);
}

// Set value to pageFlowScope
public static void setValueToPageFlowScope(String name, String value) {
  AdfFacesContext.getCurrentInstance().getPageFlowScope().put(name, value);
}

// Refresh a component from the page
public static void refreshComponent(UIComponent component) {
  AdfFacesContext.getCurrentInstance().addPartialTarget(component);
}

// Get a binding value from page
public static Object getBindingValue(String attributeName) {
  BindingContainer bindings = getBindings();
  List<AttributeBinding> attrBindings = bindings.getAttributeBindings();
  for(AttributeBinding att: attrBindings) {
     if(att.getName().equals(attributeName)) {
          return att.getInputValue();
     }
  }
  return null;
}

// Get a operationBinding defined in the page
public static OperationBinding getOperationBinding(String operation) {
  return getBindings().getOperationBinding(operation);
}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: