This discussion is archived
0 Replies Latest reply: Jun 26, 2013 4:03 AM by 47555882-06ec-4296-8bfb-30106e129f48 RSS

ADF focus on component when page is loaded

47555882-06ec-4296-8bfb-30106e129f48 Newbie
Currently Being Moderated

Hi, i need to focus on some component when the page is loaded, say one button. So the scenario is when i click one text, another panel shows and then i need to focus on the ok button in the new panel. I wrote some javascript to help focus, but the problem is when i call that method, the UIComponent is null in the backing bean. Can any one suggest a good way to handle this?

 

a sample java code is like this:

 

public class SampleBean{

     UIComponent c1;

 

     public SampleBean(){

          // some code here

          setFocus(c1);

     }

 

     public void setFocus(UIComponent c){

 

     }

}

 

So here my problem is this c1 is null when this taskflow is initialized, and hence there is no component for me to focus.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points