Hello,

I have an LOV inside a row of a grid and another region. I have a requirement like, when specific value is selected from the LOV, the region should be shown or hidden. please see the image:

alt text

When the value 'Forward' (Id: 3), is selected from LOV, the region which is on right most side, should be shown, otherwise it should be hidden.

Please guide, how can I achieve that?

Thanks

Mudi

asked 03 Aug, 00:26

Mudi's gravatar image

Mudi
1805
accept rate: 7%


To achieve this you have to store the grid cell value into a hidden item and on value change of this hidden item show or hide the Region.

Additional Info for this solution:

  • In Cell Edit Mode it fires when you leave the cell
  • In Row Edit mode it fires after the Update button is used

e.g.

  1. Create a hidden item for the value of the Grid's Select List

  2. Create a Dynamic Action on the hidden item listening to the APEX Change event having a condition (e.g. equal 3)

  3. Create a true action APEX Show to show the Forward Step (Fire On Page Load = No)

  4. Create a false action APEX Hide to hide the FOrward Step region (Fire On Page Load = Yes)

  5. Create a Dynamic Action on the Grid listening to the FOEX Grid - After Edit event

  6. Add a condition to this Dynamic Action
    (this.data && this.data.column == '<Your Grid Column Name of the LOV>')

  7. Add a true action of APEX Execute JavaScript Code to the DA
    $s('<Your Hidden Item>',this.data.record.get('<Your Grid Column Name of the LOV>'));

When you step out to the next cell, the Forward region will be shown/hidden

Example:
In the following example screenshots the hidden item is named P16_COLUMN_VALUE and the grid column is CONT_OID

alt text

alt text

alt text

alt text
 

For the false action set the Fire On Page Load = Yes to initially hide your Forward region
alt text

link

answered 03 Aug, 03:57

FOEX-SUPPORT's gravatar image

FOEX-SUPPORT
4.2k15
accept rate: 32%

edited 03 Aug, 04:35

In the third step, "Fire On Page Load = No" there is no more "Fire On Page Load" option available with us, as we are upgraded to apex 5.1.2 now. there is another option available as "Fire on Initialization", Please suggest, should I use that option as an alternative?

Thanks

Mudi

(06 Aug, 02:41) Mudi Mudi's gravatar image

Excellent!

Thank you so much, It was really helpful.

Regards, Mudi

(06 Aug, 03:00) Mudi Mudi's gravatar image

As an alternative solution you can also add a change handler to the grid column editor.

You can add a change event handler to your grid editor that will trigger a custom event e.g.

alt text

"editor": {
   "listeners": {
      "change": /**/ function(widget, newValue, oldValue) {
         apex.event.trigger(document.body, 'MyEventName', {
            value: newValue
         });
      } /**/
   }
}

Note: change MyEventName to something meaningful, taking note that it is case sensitive. Also there is currently a bug in the FDA which means you currently have to disable it and add it manually within the grid column comments e.g.

alt text

Note: until we fix the FDA bug, after adding this additional "listener" config to the column you will have to disable the FDA before making any further FOEX config changes to this column or this new "listeners" config will be lost.

You would then create a dynamic action (with true to show, false to hide) that listens to this custom event with a condition

this.data && this.data.value === "Forward"

e.g.

alt text

link

answered 03 Aug, 04:21

FOEX-SUPPORT's gravatar image

FOEX-SUPPORT
4.2k15
accept rate: 32%

edited 03 Aug, 04:22

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×35
×13
×6

Asked: 03 Aug, 00:26

Seen: 62 times

Last updated: 06 Aug, 03:00

FOEX Links