Solved

Refresh Tab that is not in View for Master/Detail grids

  • 19 March 2021
  • 6 replies
  • 642 views

Userlevel 2
Badge

I have several detail grids with one master. Each detail has its own tab. The problem is the grids that are in a tab, that is not in view, are not updated when the master record changes.

I’ve already done in aspx and code:

  • MasterGrid: <px:PXGrid
    • SyncPosition="true" KeepPosition="true"
    • <AutoCallBack Command="Refresh" Target="tree" ActiveBehavior="True">
           <Behavior RepaintControlsIDs="DetailGrid1, DetailGrid2View"               BlockPage="True" CommitChanges="False"></Behavior>
      </AutoCallBack>
      (I am unsure about Target in this case)
       
  • DetailGrid_n: <px:PXGrid
    • SkinID="DetailsInTab" SyncPosition="True”
      • <CallbackCommands>
                <Refresh SelectControlsIDs="MasterGrid" ></Refresh>
        </CallbackCommands>
         
  • Graph:
    • public SelectFrom<DetailDAC_n>
      .Where<DetailDAC_n.Id.IsEqual<MasterDAC.Id.FromCurrent>>

                  .View Details_n;

    • BLC: _(Events.RowSelected<MasterDAC> e)
      {
                 Details_n.View.RequestRefresh();
      }

 

The behavior is like this.

If the selected row in the master grid changes, the detail grid in the visible tab changes accordingly.

If the another tab is selected without selecting a row first, it correctly shows the details for the 1st master entry.

But if I select another row in master and then click on another tab, the grid still shows the details for the previous master entry.

 

Can I approve this?

icon

Best answer by Naveen Boga 22 March 2021, 07:55

View original

6 replies

Userlevel 7
Badge +17

Hi, @mhaps 

Grids Master-Detail Relationships explained well in the below Acumatica blog by Sergey Marenich with examples.

Linke: https://asiablog.acumatica.com/2019/04/grids-master-detail-relationship.html

Hope that helps!!

Userlevel 2
Badge

I had already noticed this article.It describes exactly the things I already did.

More ideas?

Userlevel 7
Badge +17

@mhaps I see above you have shared only the .aspx code, can you please alsoshare the views, which you created on the Graph?

Userlevel 2
Badge

The Views for the Details are already described in my inital post.

The PrimaryView and DataMember of MasterGrid is just like this:

        public SelectFrom<MasterDAC>.View PrimaryView;

 

If it is of interest, the MasterDAC has only on key (Id), the DetailDACs have composite keys, two or more, including the Id. This behavior, that the tabs that are not in view, are not updated is the same for all Details.

 

Userlevel 7
Badge +17

Thanks for sharing Master View as well.

In the Master Grid you have mentioned Target="tree", Can you please confirm that is Child Grid ID is the tree?

I’m assuming this is the issue if your Child grid Id is NOT tree

 

Userlevel 2
Badge

Right, tree is not one of the Detail Grids. It is a common parent. Because I thought Target can only be one item. 

Now I’ve set all IDs of my Detail Grids separated with colon, same as RepaintControlsIDs.

<AutoCallBack Command="Refresh" Target="DetailGrid1, DetailGrid2" ActiveBehavior="True">
     <Behavior RepaintControlsIDs="DetailGrid1, DetailGrid2" BlockPage="True" CommitChanges="False"></Behavior>
</AutoCallBack>

 

All Detail Grids are updated.

Thanks.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved