Forum Stats

  • 3,851,566 Users
  • 2,263,999 Discussions
  • 7,904,781 Comments

Discussions

af:selectOneChoice not refreshed upon EM(region) refresh

Punin
Punin Member Posts: 7
edited Jan 10, 2014 12:28AM in JDeveloper and ADF

Hi,

I am using JDEV version 11.1.1.7.1.

I have a <af:selectOneChoice> and a table in a region. The data in the table is rendered on the basis of selection done using <af:selectOneChoice>, between selectItem1 and selectItem2. By default when my page is loaded, the default option is selectItem1, and dataset1 is rendered.

I face the following issue:

Step1: I select selectItem2, value change is triggered and dataset2 is shown in table (as expected).

Step2: I do an EM refresh, (little refresh button on the top right hand corner of the pageTemplate in Enterprise Manager UI)-  the entire region is refreshed, the table is rendered with default dataset1(as expected) since the default value is selectItem1. But <af:selectOneChoice> is not refreshed, and it still shows selectItem2 as selected.

Am I missing some setting here ? Please help. Let me know if more information is required.

Thanks in Advance,

Punin

Answers

  • Ram-Oracle
    Ram-Oracle Member Posts: 6

    Try binding your af:selectOnChoice to a variable in region's managed bean.

    Example:

    <af:selectOneChoice

                           value="#{pageFlowScope.managedBean.variable}"

                           id="soc1" autoSubmit="true"

                           valueChangeListener="#{pageFlowScope.managedBean.ValueChangeListener}"

                           >

    -Ram

  • Punin
    Punin Member Posts: 7

    Hi Ram,

    I have it already bound to a variable in region's managed bean:

    Here's a rough snippet:

    <af:selectOneChoice  autoSubmit="true" id="soc1"

                                    label="#{resourceBundle.VIEW_CHOICE}"

                                    valueChangeListener="#{backingBeanScope.viewBean.valueChangeListenerMethod}"

                                    value="#{pageFlowScope.modelBean.selectedItem}">

                                <af:forEach var="item"

                                        items="#{pageFlowScope.modelBean.allItems}">

                                  <af:selectItem id="it1" label="#{item.label}" value="#{item.value}"/>

                                </af:forEach>

                              </af:selectOneChoice>

  • Ram-Oracle
    Ram-Oracle Member Posts: 6

    Is selectedItem matches item.value? i.e. is #{pageFlowScope.modelBean.selectedItem} equals #{item.value}?  Other than this, could not see what could be wrong.

  • Punin
    Punin Member Posts: 7

    Yes, it is the same.

    -Punin

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

    When you refresh the page the bean value (you bound the SOC value to) is not reset to the default value. This you have to do yourself.

    Timo

  • Punin
    Punin Member Posts: 7

    Hi Timo,

    The bean value is reset to default value( to selectItem1) , and therefore the data shown in the table is dataset1. It's only the UI where the old value(selectItem2) is shown in dropdown.

    Thanks,

    Punin

This discussion has been closed.