foex-open-source / fos-interactive-grid-add-button

MIT License
9 stars 2 forks source link

FOS Interactive Grid Add Button to Row Menu: Choosing menu does not result in grid row change #7

Closed SoftPath-inc closed 3 years ago

SoftPath-inc commented 3 years ago

First, thanks for making these plugins available. They are great. To access the currently selected IG row primary key value, I am using a dynamic action to recognize the IG row change and update an item's value with the newly selected row's primary key. I am using FOS Interactive Grid Add Button to Row Menu to add a row level menu item that fires a PL/SQL procedure using the primary key value as a parameter indicating the row to act on. If a user clicks on the row hamburger menu without clicking on the row the row change event is not triggered, resulting in either no value in the primary key item if IG just refreshed and no row selected yet, or the value of the last selected row's primary key. Therefore, when the procedure called in the Menu action executes using the Item containing the primary key value it points to the prior selected row, or null if no row selected yet. Is there a way to trigger the row change event when clicking on the menu, or access the primary key in another way? A danger is if the user thinks they select another row by choosing a hamburger menu option directly when in fact the primary key still points to the old row the menu option will execute on the old row, not they one they think they selected. Thoughts?

stefandobre commented 3 years ago

Hi there,

I think what you're looking for is exactly the first feature described in Example 6 here: https://fos.world/ords/f?p=10000:2010

In short, don't use the row changed event to keep track of the Primary Key. When adding the button, set the On Click attribute to Return Primary Key(s) into Item like in the image below, provide some item, then create a second DA that listens on change of said item, which then executes your PL/SQL.

Let me know if that helps. -Stefan

SoftPath-inc commented 3 years ago

That works great! I am glad I asked and stopped banging my head against the wall :) Have a nice day! Joe

stefandobre commented 3 years ago

Good to hear! Ask anything else, anytime. The FOS folks are super helpful :)