title: Create UI components on page load
body: <p>I am currently working on oracle adf task flows and regions and I want to create and update some UI components on page load and for this I am using method call activity as default.The problem is that I am getting null values  following is my code in the bean that executes on the method call.</p>
  
  <pre><code>package view;
  
  import javax.faces.component.UIViewRoot;
  import javax.faces.context.FacesContext;
  
  import oracle.adf.view.rich.component.rich.output.RichOutputText;
  
  public class testBean {
      public testBean() {
      }
  
      public String testMethod() {
          // Add event code here...
  
  
  
          FacesContext facesContext = FacesContext.getCurrentInstance();
          UIViewRoot root = facesContext.getViewRoot();
  
  
          RichOutputText text =    ( RichOutputText )root.findComponent( "r1:ot1" );
  
          text.setValue( "Adding text on run time" );
  
          return "product";
  
      }
  }
  </code></pre>
  
  <p>The set value method returning me null may be it is because the fragment product.jsff which is the view activity is not initiated and the output text with ot1 returning null.</p>