Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Call a bean method after page load in jsff file

Rajan SMDec 23 2014 — edited Dec 24 2014

Hi All,

I am working on JDeveloper 11.1.1.7.0.

I need to call a managed bean method after jsff is loaded. My requirement is that, I need to dynamically add RichImage components on my page. So I have put a PanelGroupLayout as a container on the page. I am adding the RichImages to this PanelGroupLayout with

parentUIComponent.getChildren().add(childUIComponent);

I tried using regionController, but it is giving me Null Pointer as regionController doesn't have access to the UI components on page.

then I tried with javascript, but it is not firing my managed bean method. I have put below code in my home.jspx

<af:document id="d1">

   

    <af:serverListener type="onloadEvent" method="#{viewScope.ConnPocBean.initMethod}"/>

    <af:resource type="javascript">

    function onLoadClient(event) {

      AdfCustomEvent.queue(event.getSource(),"onloadEvent",{},false);

      return true;

    }

    </af:resource>

and below code in my testPage.jsff file

<af:clientListener method="onLoadClient" type="load"/>

But here, when my testPage.jsff loads..initMethod() is not getting fired.

Please let me know what is wrong here.

thanks,

Rajan

This post has been answered by amishra on Dec 23 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 21 2015
Added on Dec 23 2014
11 comments
3,715 views