Forum Stats

  • 3,770,050 Users
  • 2,253,054 Discussions
  • 7,875,283 Comments

Discussions

ADF Declarative Components (JDev 12.2.12)

LCabaco
LCabaco Member Posts: 66
edited Jul 6, 2018 8:38PM in JDeveloper and ADF

Hello guys,

I've been creating some custom declarative components using the tutorials provided by oracle.

One of the components i use, is a custom dropdown , wich I need to have multiple of this components on the same page.

This component has some methods attached on it's attributes, that are called on the render.

The component also have a action event which needs to refresh the component.

The issue i have , is that for every click (and refresh on THAT action source), all the other custom components are getting refreshed too,

and i can't really figure out why.

This is causing me a huge performance issue, and i have no clue what is causing this.

Can someone help me with a solution, or have an idea on what i can try to at least figure out whats causing the refreshes on the other custom components?

Best regards,

Luís Cabaço

«1

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,669 Red Diamond
    edited May 23, 2018 1:53PM

    One reason might be auto PPR. Meaning if that all components in the same container get a PPR if one component is refreshed.

    To see what happens you can use developer tools of your browser and look at the network traffic. There you should see which component sends the first refresh and multiple other calls to the other components. Yu turn this behavior of look at Andrejus Baranovskis Blog: Evil Behind ChangeEventPolicy PPR in CRUD ADF 12c and WebLogic Stuck Threads

    Timo

  • LCabaco
    LCabaco Member Posts: 66
    edited May 24, 2018 6:46AM

    Hello Timo,

    I've checked with the Page bindings, and the iterators that the components use have the property "ChangeEventPolicy" set to (none) , which is the default value on this version.

    Any other idea on what can be causing the issue?

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,669 Red Diamond
    edited May 24, 2018 12:23PM

    The default fit the change event policy for your version is 'ppr'. That's the reason I asked you to check.

    Have you investigated the network traffic?

    Timo

  • LCabaco
    LCabaco Member Posts: 66
    edited May 25, 2018 4:59AM

    Hello Timo,

    Maybe i'm looking on the wrong place, but i see the default "ChangeEventPolicy" as "none(default)" on the iterators.

    Another thing that is confusing me is that my custom dropdowns are actually buttons that trigger, a popup. And programatically i'll execute the function and fill the list based on the iterator Rows.

    So, the render shouldn't be messing with the iterators right? It only shows and fill the popup when clicking on the dropdown.

    change_event_policy_default.png

    Also, with the Network traffic, i'm not used to it and i really don't know how to search for.

    When i do the click, i get only one POST method with the following response:

    <?xml version="1.0" ?>

    <partial-response><changes> <extension processed="regMain:0:rInventoryContent" immediateOnly="false" id="adf-processed-roots-ext"/><update id="regMain:0:rInventoryContent:0:rb1:dc_b1"><![CDATA[<div id="regMain:0:rInventoryContent:0:rb1:dc_b1" class="xfl p_AFTextOnly" style="background-color: rgb(33,85,235) !important;" _afrGrp="0" role="presentation"><a href="#" onclick="this.focus();return false" data-afr-fcs="true" class="xfn" role="button"><span class="xfv">Nr: 54</span></a></div>]]></update><update id="f1::postscript"><![CDATA[<span id="f1::postscript"><span id="f1::postscript:st"></span></span>]]></update><update id="javax.faces.ViewState"><![CDATA[!-is4pa0ia6]]></update><eval><![CDATA[AdfPage.PAGE.__handleRichResponseAction('/Booq/faces/pages/Main.jsf');]]></eval><extension id="adf-script-library">/Booq/afr/partition/unknown/n/default/opt/d/background-ASPEN-7005.js</extension><eval><![CDATA[AdfPage.PAGE.setPageStateId("1");AdfPage.PAGE.addComponents(new AdfRichButton('regMain:0:rInventoryContent:0:rb1:dc_b1'));AdfPage.PAGE.__initializeSessionTimeoutTimer(3600000, 120000, "http://lcabaco-jdev122.conceptsoftware.eu:8002/Booq/faces/pages/Main.jsf");AdfPage.PAGE.__initUserInactivityTimeout(600000);AdfPage.PAGE.__setShouldValidateEmptyFields(true);AdfPage.PAGE.clearMessages();AdfPage.PAGE.clearSubtreeMessages('regMain:0:rInventoryContent');]]></eval></changes></partial-response>

    dev_tools_response_1.jpg

    Best regards,

    Luís Cabaço

  • dvohra21
    dvohra21 Member Posts: 14,254 Gold Crown
    edited May 26, 2018 7:58PM

    This how-to document explains how declarative

    components are build in JDeveloper 11, how the

    component can be configured to read its data from the

    ADF binding layer and how partial page refresh (PPR) can

    be used to conditionally refresh a declarative component.

    Refer section "Enabling declarative components for Partial Page Rendering"

    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/005-how-to-bind-decl-comp-169123.pdf

  • LCabaco
    LCabaco Member Posts: 66
    edited May 28, 2018 4:59AM

    Hello dvohra21,

    Thanks for the tutorial.

    As the tutorial refers, declarative components do not do a PPR by default, and Frank explains a way to enable this.

    My declarative components is basically a Button that displays a popup on click. That popup has a list inside with single selection enabled.

    The purpose is to select the item on the list, and show that value on the button text. (Simulating a dropdown component).

    When i do the selection i change the custom component text atribute, and programatically refresh the button in order to display the new selected text.

    The issue is that "ON EVERY ACTION" that i do, all the custom components get refreshed , and make calls to the linked functions through attributes.

    And i really need to disable this behaviour. I don't mind that the same component might render two or three times. My issue is that i have around 10 of this components

    on my page, and if i clique one of them, all the others start calling their functions because all are rerendering.

  • dvohra21
    dvohra21 Member Posts: 14,254 Gold Crown
    edited May 28, 2018 7:56PM

    Do all components have the same enclosing component? If not, set the partialTrigger attribute of its enclosing component so when the enclosing component refreshes it in turn will render this component. If it is just one component that is modified enclose the component in a separate element. And enclose all the other components in a separate element. A refresh of the single element won't effect the other components.

  • LCabaco
    LCabaco Member Posts: 66
    edited May 29, 2018 9:44AM

    Hello dvohra21,

    I have two groups of panelFormLayouts. Both with the custom components inside of them.

    All of them are refreshing, no matter being inside the same parent (panelFormLayout) , or being on the other panelFormLayout.

    See the structure below:

    customComponents_Structure.jpg

  • dvohra21
    dvohra21 Member Posts: 14,254 Gold Crown
    edited May 31, 2018 5:18PM

    set the partialTrigger attribute only in th enclosing element whose custom components need to be refreshed.

  • LCabaco
    LCabaco Member Posts: 66
    edited Jun 13, 2018 5:30AM

    dvohra21,

    I have no partial triggers set. The only refreshes i do is programmatically inside the Custom Component Bean, since i need the text on the button to be refreshed after selecting an item from the List. And the list refreshed when pressing the button.

    Note that this button/list visually simulates a List Of Values, that's why i have both components.

    Given this i can not find an explanation for all the custom components getting refreshed when i press one of them. They should be refreshing it's own components, and not the others since there are no references or triggers to the parent in the client application.

This discussion has been closed.