For example - https://apex.oracle.com/pls/apex/f?p=11830:2::::::
The two lower grids are connected to the upper one through the master.
They have dynamic action "Selection change" in which I get the code of the selected row.
Sometimes it happens: