This discussion is archived
6 Replies Latest reply: Aug 20, 2013 8:01 AM by LindaInci RSS

value change listeners are firing when not expected

Rahul More Newbie
Currently Being Moderated

I have written value change listeners for two Select One Choices

They are getting called correctly when the values are changed in those two SOCs.

 

But they are also getting called for every other action on the page e.g. 1) on Button Click 2) on Row Selection

 

I have not included those value change listeners in any other component's Listeners.

Looks like my whole page is getting refreshed when I do any action on my page.

 

AutoSubmit is True for both of the Select One Choices since the next table is getting derived from the values selected from these two.

 

 

My only expectation is that the value change listener written for SOC should only get called only when some action happens on that.

But it gets called for all other actions as well.....

Has anyone faced this issue before?

 

 

Thanks

Rahul

  • 1. Re: value change listeners are firing when not expected
    LindaInci Explorer
    Currently Being Moderated

    Hi Rahul,

     

    tell us your JDev version and give us some more information about your page. Maybe you could share some code.

     

    Regards,

    Linda

  • 2. Re: value change listeners are firing when not expected
    vinaykumar2 Expert
    Currently Being Moderated

    i never heard of this.can u past the source code?

  • 3. Re: value change listeners are firing when not expected
    Rahul More Newbie
    Currently Being Moderated

    I am using Jdev 11.1.2.3 (Release 2)

     

    This is my Value Change Listener.....

     

        public void onSelectTargetPart(ValueChangeEvent valueChangeEvent){

                 

            System.out.println("..................... Inside the onSelectTargetPart ValueChange Listener............");       

           

           BigDecimal d =(BigDecimal)valueChangeEvent.getNewValue();

           int  TargetInvId = d.intValue();      

           l_TargetPart= Integer.toString(TargetInvId);

                          

                 }   

     

    and it is associated with only one SOC and with no other component as follows

     

    <af:selectOneChoice value="#{bindings.TargetPart.inputValue}"

                                                                label="#{bindings.TargetPart.label}"

                                                                required="#{bindings.TargetPart.hints.mandatory}"

                                                                shortDesc="#{bindings.TargetPart.hints.tooltip}" id="soc5"

                                                                binding="#{backingBeanScope.backing_StartsSort.soc5}"

                                                                valueChangeListener="#{backingBeanScope.backing_StartsSort.onSelectTargetPart}"

                                                                autoSubmit="true" disabled="true">

                                                <f:selectItems value="#{bindings.TargetPart.items}" id="si5"

                                                               binding="#{backingBeanScope.backing_StartsSort.si5}"/>

                                            </af:selectOneChoice>

  • 4. Re: value change listeners are firing when not expected
    Frank Nimphius Employee ACE
    Currently Being Moderated

    Hi,

     

    this statement is not correct:

     

    Looks like my whole page is getting refreshed when I do any action on my page.

     

    In fact what you see is that the form gets submitted with each action. The value change listener always fires when a form is submitted with the selectChoice component values being altered before. So you may want to check if the value of the select component is changed to a time that you press a command button

     

    Frank

  • 5. Re: value change listeners are firing when not expected
    Rahul More Newbie
    Currently Being Moderated

    Though this que. is not answered, I tried workaround as follows....

     

    Though my Go button is not touching the VOs at all.... those value change listeners for SOCs are still firing when I press Go button on the form.

    Any ways.. I store user selected values in static variables.. and show them in panelLabelText just to make them feel that once selected values from SOC can not be changed. (I gave separate Reset button to allow user to choose once again).

    I put them in separate form and now only that particular form gets refreshed when i press button. This is how I make the whole page not get refreshed.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    May be Oracle ADF Developers if they want  to re-produce the issue and have a look.

     

    I have 3 Select one choice and one Command button in a form.

    When the first Select one choice is selected values of other two select one choices get changed.

     

    E.g. Lets say first SOC is location. second SOC is Departments third SOC is Emlpoyees and there is Go button to find out that particular employee details in the form below.

    when you select location....  all Departments from that location gets filled up. and all employees from that location fill up third SOC.

     

    How I did this:

    ---------------------

    VO on location, read only VO for Dept and Employees.

    added two transient attributes "Dept" (Lov From Dept VO) & "Employees" (Lov from Employes VO) to location VO .

    Drag and Drop location VO as SOC, and drop individual transient attribute as SOC

     

    A user selects a value from all three SOC and press Go button.

    Go Button will query altogether different VO (not based on any of the above ones)

     

    My question is when I press Go button only user selected value in location SOC remains and user selected values in two transient attributes lovs goes blank. since the whole form gets refreshed...

     

     

    Thanks
    Rahul

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points