Skip to main content
Solved

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

  • Mar 19, 2021 9:08 AM UTC
  • 6 replies
  • 842 views
  • Translate All

Forum|alt.badge.img

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?

Best answer by Naveen Boga

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. 

 

View original

6 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Mar 20, 2021 1:19 PM UTC

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!!

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Mar 22, 2021 5:44 AM UTC

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

More ideas?

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Mar 22, 2021 5:59 AM UTC

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

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Mar 22, 2021 6:32 AM UTC

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.

 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Answer
  • Mar 22, 2021 6:55 AM UTC

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. 

 

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Mar 22, 2021 8:48 AM UTC

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.

Translate