Hi all,
I want to, write some java code that must work while the page is loaded. For example, I want to populate the datatable in the page while the page is opening. I tried the setForm method of the page's backing bean but didnt work. The same code works if I put it under the same page's command button action. Then, I tried the constructor. The bean is in the request scope.
But in the constructor, I cant access the beans other objects. For example, there is a dataTable in the page and I want to populate it in the constructor. But when I access the dataTable object in the constructor, it gives nullPointerException in the runtime. (for ex: dataTable2.setBorder(1); throws exception in the constructor). The same code works if i put it under a command buttons action in the sam page..
I think, there must be a solution for initialization the page objects.
Thanks...