Forum Stats

  • 3,827,580 Users
  • 2,260,795 Discussions
  • 7,897,305 Comments

Discussions

Possible a bug from cascade select list

bsalvador
bsalvador Member Posts: 38
edited Jan 16, 2014 12:38PM in APEX Discussions

Hi people,

I created a dynamic action "onChange" in a page item called "P5_COD". Always "P5_COD" value changes, it executes PL/SQL code above to populate page items with data from database:

select

   PERIOD,

   BEGIN_DATE,

   FINISH_DATE

into

  :P5_PERIOD,

  :P5_BEGIN_DATE,

  :P5_FINISH_DATE

FROM ...

BEGIN_DATE and FINISH_DATE are "select list" page items. They are "Cascading LOV Parent Item(s)" from PERIOD (select list too).

The problem is: The "onChange" dynamic action doesn´t work to load BEGIN_DATE and FINISH_DATE page items.  BEGIN_DATE and FINISH_DATE load default data and not data from database.

Any idea?

Thanks,

Bsalvador

Best Answer

  • Nicolette
    Nicolette Member Posts: 526 Silver Badge

    Bsalvador

    First the code you have listed doesn't change the value of the items on the client side only in session state. In other words only on the server.

    Use a dynamic action of type "Set value" to change the value on the client side.

    Secondly changing the value of P5_PERIOD will trigger the change of the LOV of P5_BEGIN_DATE  :P5_FINISH_DATE and the values of these items are reset to null (client side only).

    In a similar challenge of setting the value of the parent and child simultaneously I ended up setting the value of the child item in a hidden item. And on the afterrefresh event of the child the value is set to  the child.

    See this demo I have made for that challenge.

    Nicolette

Answers

  • Nicolette
    Nicolette Member Posts: 526 Silver Badge

    Bsalvador

    First the code you have listed doesn't change the value of the items on the client side only in session state. In other words only on the server.

    Use a dynamic action of type "Set value" to change the value on the client side.

    Secondly changing the value of P5_PERIOD will trigger the change of the LOV of P5_BEGIN_DATE  :P5_FINISH_DATE and the values of these items are reset to null (client side only).

    In a similar challenge of setting the value of the parent and child simultaneously I ended up setting the value of the child item in a hidden item. And on the afterrefresh event of the child the value is set to  the child.

    See this demo I have made for that challenge.

    Nicolette

  • bsalvador
    bsalvador Member Posts: 38

    Thanks Nicolette. I followed everything you told me and it works! Thank you very much!

    Bsalvador.

This discussion has been closed.