Forum Stats

  • 3,826,921 Users
  • 2,260,725 Discussions
  • 7,897,122 Comments

Discussions

Clearing initial values

848013
848013 Member Posts: 309 Bronze Badge

Hi

I am on Jdev 12.2.1.4. I have a popup which gets launched from a button. In the popup, i have a list box. i select value in this list box and close the popup by clicking ok button

When i open popup again, i see old values. how can i clear these values?

my popup has table based on view object and the listbox is transient attribute in this vo

For eaxmple, please see "Match To" column below. These values must be cleared when i open popup


Thanks

Lakshmi

«1

Answers

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

    Have you set the contentDelivery property of the af:popup to 'lazyUncached'?

    Timo

  • 848013
    848013 Member Posts: 309 Bronze Badge

    Yes Timo. it is set as "LazyUncached". but still i see the old values when i open popup

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

    So, where does the popup get its data from?

    In the end, you have to clear the data yourself by either using the reset action listener or some reset util.


    Timo

  • 848013
    848013 Member Posts: 309 Bronze Badge

    Hi Timo

    I didnt quite get it. Data comes from the viewobject (database table). In this view object, i have added a transient attribute as "selectManyChoice". All otehr fields are refreshed upon popup launch except this selectmanychoice item.

    I have exposed this item to binding layer and set the value as null. "This.smc.setValue("")". When i do this, i see the value is cleared when i launch the popup. But when i click on the list, no values are shown

    Thanks

    Lakshmi

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

    As you need the attribute for each row, the transient attribute should be added to the EntityObject. From the VOs point of view, there is no difference between the SOC and the other attributes this way. Only the EO (representing one row) knows the difference.

    The next question is if the selected value is auto submitted to the model layer. In this case, the data is hold in the row and shown the next time you show the data.


    What does 'this.smc.setValue("")' mean?

    Where is this code called?

    Which class?


    Timo

  • 848013
    848013 Member Posts: 309 Bronze Badge

    Hi Timo

    I dont have any EO. I have a readonly VO. In this, i have added a transient attribute. but i cannot drag and drop this transient attribute as select many choice. so i dragged this transient attribute as SelectOneChoice and Modified to SelectManyChoice.

    I am populating the values to this component from bean. here is the code

    <af:column headerText="Match To"

                                    id="c40">

                                <af:selectManyChoice label="Label 2"

                                           valueChangeListener="#{pageFlowScope.vfibean.setPOMatchLineNo}"

                                           id="smc1" valuePassThru="true"

                                           simple="true" autoSubmit="true">

                                  <f:selectItems value="#{pageFlowScope.vfibean.allValuesList}"

                                          id="si14"/>

                                </af:selectManyChoice>

                              </af:column>

    please ignore this.smc.setValue(""). i have removed this my mistake.

    Thanks

    Lakshmi

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

    Your selectManyChoice doesn't have the value property defined. It will not store the selected values anywhere.

    I guess you do something in the valueChangeListener. And as you Auto submit the selection, you have to clear the values yourself. You tricked the framework. More you have to clear the values by testing the values as you did in the listener.


    Timo

  • 848013
    848013 Member Posts: 309 Bronze Badge

    Hi Timo

    This is where i have no clue and need some help. Since the value attribute is not setup, where is this value stored? because when i open the popup, i see he old values. is there any property to clear component value?

    Thanks

    Lakshmi

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

    You have added a transient attribute to the VO. You can set the value property to this transient attribute.

    However, when you auto submit the values they are stored in the viewrow and the next time you see the same row they are still there. To clear the value, you clear the transient attribute in the view row.


    Timo

  • 848013
    848013 Member Posts: 309 Bronze Badge

    Hi Timo

    Need some help here. I could not clear the initial value in "SelectManyChoice" component.Attached sample app based on employees and departments .

    1. Click on Select Many Choice Button

    2. popup opens and fetches data

    3. Select the value from select many choice field

    4. Click ok to close the pop up

    5. Click on Select Many Choice Button AGAIN

    Old value still stays there.