Forum Stats

  • 3,757,060 Users
  • 2,251,192 Discussions
  • 7,869,716 Comments

Discussions

How to fire clientListener when reloading the ADF fragment?

User_8PMDV
User_8PMDV Member Posts: 25 Green Ribbon

Hi,

I am using jDeveloper 12.2.1.3 to develop a responsive application with clientListener to give different layouts when page loading.

It works well in JSF file, while not fire in JSFF files. I tried to add the resource javascript code to jsff and also wrap clientListener with af:poll without any luck.

As indicated in a previous blog post https://stackoverflow.com/questions/35127482/is-there-no-client-side-load-event-for-a-jsf-fragment, the clientListener should fire with af:poll wrapper. I don't have any idea why it doesn't work in my case.

In jsff file:

<af:panelGroupLayout>

<af:resourse type="javascript">

function changeLayout() {

var sorbId=AdfPage.PAGE.findComponenntByAbsoluteId('sorbId');

if(window.matchMedia("(min-width: 480px)").matches) {

sorbId.setProperty("layout", "horizontal");

} else {

sorbId.setProperty("layout", "vertictal");

}

</af:resource>

<af:selectOneRadio id="sorbId">

<af:poll id="p1" interval="5000" timeout="600000" immediate="true" rendered="true">

<af:clientListener method="changeLayout" type="poll"/>

</af:selectOneRadio>

</af:panelGroupLayout>

Tagged:

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,540 Red Diamond

    User, you should provide a complete reusable test case for this.

    Your implementation differs from the one in the blog. Have you tried it the same way as shown in the blog?

    Have you checked if the client listener fires at all?

    From your code, it's not clear. My guess is that your javascript is called, but can't find the component.


    Timo


  • User_8PMDV
    User_8PMDV Member Posts: 25 Green Ribbon

    Thanks Timo for suggestions. I have made it work by putting the af:poll tag right above the af:selectoOneChoice tag like below:

    <af:poll id="p1" interval="200">

    <af:clientListener method="changeLayout" type="poll"/>

    </af:poll>

    <af:selectOneRadio id="sorbId">

    </af:selectOneRadio>