I am displaying few textboxes on my custom smartpanel. The text to display is obtained by clicking each row in the grid and showed on smartpanel.
However, the issue is whenever I click on first time any row, it displays correctly all text correctly but next time onwards it still shows the previous one and do not get refreshed.
Here is the code I am using-
public PXSelect<CRAcumaticaActivity,
Where<CRAcumaticaActivity.activityID, Equal<Current<CRAcumaticaActivity.activityID>>>> CurrentAcuViewActivity;
public PXAction<CRCase> acuViewActivity;
[PXButton(ImageKey = PX.Web.UI.Sprite.Main.ArrowUp, CommitChanges = false)]
[PXUIField(DisplayName = "View Activity", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
protected virtual IEnumerable AcuViewActivity(PXAdapter adapter)
{
CurrentAcuViewActivity.AskExt();
return adapter.Get();
}
Here is the smartpanel aspx code-
<px:PXSmartPanel ID="pnlAcuViewActivity" runat="server" Style="z-index: 108;"
Caption="Acumatica Activity" CaptionVisible="True" LoadOnDemand="true"
ShowAfterLoad="true" AutoCallBack-Command="Refresh" Key="CurrentAcuViewActivity"
AutoCallBack-Target="frmAcuViewActivity" DesignView="Content"
AcceptButtonID="PXButtonOK" CancelButtonID="PXButtonOK">
<px:PXFormView ID="frmAcuViewActivity" runat="server" DataSourceID="ds" DataMember="CurrentAcuViewActivity"
Style="z-index: 100"
Caption="Acumatica Activity" CaptionVisible="False"
SkinID="Transparent" TabIndex="17100">
<Template>
<px:PXLayoutRule runat="server" StartRow="True">
</px:PXLayoutRule>
<px:PXTextEdit ID="edSummary" runat="server" DataField="Summary" Enabled="false">
</px:PXTextEdit>
<px:PXRichTextEdit ID="edDescription" runat="server" DataField="Description" Height="200px" Width="500px">
</px:PXRichTextEdit>
</Template>
</px:PXFormView>
<px:PXPanel ID="PXPanel1" runat="server" SkinID="Buttons">
<px:PXButton ID="pxBtnOK" runat="server" DialogResult="OK" Text="Close" />
</px:PXPanel>
</px:PXSmartPanel>
Is there anything I am missing. Please suggest.
Did you set the grid's SyncPosition = true?
If still not working just try clearing the cache of the related view for every select using a delegate.
NOT TESTED
To refresh data in a SmartPanel you should use AskExt(PXView.InitializePanel initializeHandler, bool refreshRequired); the code will look like this:
For your smartpanel, why do you have: ShowAfterLoad, AutoCallBack-*, and AcceptButtonID/CancelButtonID set to same button?
ShowAfterLoad property controls the display during loading of the panel. AutoCallBack properties apply to any callback generated by controls on the panel
I suggest to have your smartpanel declared as follows: Note, AutoRepaint property which forces the panel to repaint itself everytime it opens.
The other thing I can think of is you should ensure not to use the same data view in more than one container.