4 Replies Latest reply on Jun 5, 2020 9:06 AM by Andreas Wildmann

    Question about interaction between two IGs

    Andreas Wildmann

      Hi everyone,


      I'm currently looking into something that might be an issue in a page I'm working on. The page is structured like this:


      I have 2 Interactive Grids, the Mastel Detail one in the left, and a secondary Grid to the right, that is refreshed to show the respective data in regards to the chosen row in the Mastel Detail Grid.


      Here is the interaction though, whenever I change data on the secondary Grid, I usually have to press a Save button on top of the page, that saves all data in the Grids (in the proper sequence).


      If, however, instead of saving the secondary Grid, and I decide to click a different row in the Master Detal Grid, I get an error message saying "You haven't saved your changes" with the Ok and Cancel options.


      If I click cancel, the click to change Rows in the Mastel Detail Grid still gets processed, and the data being shown on the grid on the right is still the same, without truly loading the data associated with the new row being clicked. If I save that, it'll be saved into the 2nd row that I cliked (ergo, the wrong one) instead of the correct one, overwriting the data the data that was previously saved.


      Is there a way to avoid that, and have the selected row remain the one that was already selected, instead of letting the user select the new row? Or is it even possible to "keep" the changes in the previously selected row while browing the other row?


      edit: The Master Detail Grid has now been set properly, however, the data isn't being shown in the child grid. When performing the same query used in the child grid, but in the developer, I can retrieve the data stored in it, but in the page it fails to retrieve and show it. Is there something missing in the Master Detail Grid? The Master Column is properly set, but I don't know what might be missing.

        • 1. Re: Question about interaction between two IGs

          That's interesting, I have a page with a master grid and detail grid and thought I'd check as this doesn't sound good.


          When I navigate to a different master without saving the detail it doesn't ask me to save, is that a setting somewhere?  I can try it if you remind me how to set that up?


          I can go to a different master record, create a detail record for it and not save, going back to my original master record the unsaved detail record correct for that master is still there.


          When I save both detail records are saved to the correct master, it never asks me to save.


          Does the detail grid have a column which is nominated as having a master column and that master column is definitely unique?


          Not sure if it makes any difference, I'm using 20.1 and for processing my master grid is set to automatic row processing and the detail is set to PL/SQL

          • 2. Re: Question about interaction between two IGs
            Andreas Wildmann

            I had some progress since yesterday. Apparently, while the two grids followed a Master Detal structure, it wasn't set up as that. Now it is. The Interactive grid on the right side has the left grid as being the Master Detail, while it also has one of it's keys marked as a Master Column.


            Saving it does work as well, but with a quirk. When I add new information into a row, then change it to another row, I still get the "You haven't saved" mesage. When I cancel, it still changes to the row that I just clicked, and if I save, it does save it to the previous row, not the current one. So far so good.


            However, the information i saved isn't being shown. I checked the database and the saved information has been stored in the table, but it isn't being shown on the grid. At first I thought it had simply refreshed, and I rather needed to load the page again, but it still doesn't show the data. Kinda curious if this is a glitch or I'm making a mistake when it comes to understanding how these Master Detail Grids are set up.

            • 3. Re: Question about interaction between two IGs
              Andreas Wildmann

              Just another update, the data is now being shown in accord to the Master Column. Becaus there were a couple of unintuitive primary keys in that query, I mistook one of them. But as usual, there is another problem:


              This the sequence of the issue:


              1. When first selecting a row in the Master Detal, I can see the data on the Child Grid properly.


              2. When then selecting another row in the Master Detail, the data from the currently selected row loads properly in the Child Grid.


              3. Now I click again on the row from before in the Master Detail, and the Child Grid is empty.


              Considering that the Child Grid depends on the Master Column, I don't think it is an issue regarding the assynchronous loading of that column.


              Doing a quick debug also brings me some random results. At times, I get nothing but the foreign key inside the table (with the Grid also being empty) while at times I do get something in the console.log command, but the Grid is empty.

              • 4. Re: Question about interaction between two IGs
                Andreas Wildmann

                Feels like I'm flooding my own topic while also seeming like I'm talking to a mirror.


                I solved the issue somewhat by accident. I suspected it could've been that but only now tested it properly.


                I had a "where foreign_key = :FK" condition in the Child Grid, while also having the Foreign Key in it be the Master Column, and I imagine that was causing a conflict.


                Now everything is working properly, the records aren't being saved in the wrong row,and the data in the Child Grid is being shown.