Skip to main content
Question

PXHtmlView Not Refreshing After Callback Inside PXGridWithPreview Preview Panel, Acumatica 25R2

  • April 10, 2026
  • 1 reply
  • 73 views

What We Are Building

We have a customization on the Cases screen that adds a Sub Tasks grid using PXGridWithPreview. Each sub task has a ChatLog field (PXDBText) that stores an HTML chat-style log, and a MessageText field (PXString, unbound) for the user to type a new message. A Send button appends the message to ChatLog and saves it to the database via a PXAction.

The preview panel shows the message input (PXRichTextEdit) and the chat log (PXHtmlView) below it.

The Problem

After clicking Send, the ChatLog in the database updates correctly. However, the PXHtmlView displaying ChatLog in the preview panel does not refresh — it still shows the old content. The user has to click away to another row and come back to see the updated chat log.

What We Have Already Tried

Server side:

  • CaseSubTasks.Cache.Clear() and CaseSubTasks.Cache.ClearQueryCache() after save
  • Re-fetching the record via PXSelect and reassigning CaseSubTasks.Current
  • CaseSubTasks.View.RequestRefresh()

ASPX side:

  • RepaintControls="All" on the button AutoCallBack
  • RepaintControlsIDs="htmlChatLog" explicitly targeting the control
  • RenderStyle="Simple" on the PXHtmlView
  • Wrapping PXHtmlView in a PXFormView with explicit DataMember
  • Adding PXTab inside the preview panel with two tabs
  • Replacing PXHtmlView with PXRichTextEdit in readonly mode
  • Replacing PXHtmlView with PXTextEdit in readonly mode (to test binding)

JavaScript side:

  • Using px_all['htmlChatLog'].refresh() via ClientEvents AfterRepaint
  • Using px_all['grdAActivities'].selectRow() to force row reselect after send
  • Hooking PXCallbackManager.prototype.processCallback — fails with PXCallbackManager is not defined in the iframe context
  • Intercepting XMLHttpRequest to detect submitMessage callback and trigger row reselect — causes an infinite loop of CaseSubTasks$RefreshPreview callbacks

1 reply

arpine08
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • April 12, 2026

Hi ​@krushil,

I suggest resolving this by imitating the standard Activities tab logic (e.g., the Create Task action) found in the Cases screen. The key is using a PopupCommand to trigger a secondary hidden Refresh action after Send logic completes.

Define your Send action with a PopupCommand, then create the hidden Refresh action.

// The main Send action
public PXAction<YourHeaderDAC> Send;
[PXUIField(DisplayName = "Send")]
[PXButton(CommitChanges = true, DisplayOnMainToolbar = false, PopupCommand = "RefreshCaseSubTasks")]
public virtual IEnumerable send(PXAdapter adapter)
{
// ... your logic ...
return adapter.Get();
}

// The hidden Refresh action
public PXAction<YourHeaderDAC> RefreshCaseSubTasks;
[PXUIField(Visible = false, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton(DisplayOnMainToolbar = false)]
public virtual void refreshCaseSubTasks()
{
Base.SelectTimeStamp();
Base.Caches<YourSubTaskDAC>().ClearQueryCache();

// Force the view to refresh
// CaseSubTasks.View.RequestRefresh();
}

For the Refresh action, the logic is imitated from the LocationDetailsExt.cs → RefreshLocation action instead of ActivityDetailsExt.cs → RefreshActivities action. (This approach uses ClearQueryCache() instead of calling if (!Base.IsDirty)  Base.Actions.PressCancel();)

 

ASPX page:  Add the PopupCommand to the Send button like this:

<px:PXToolBarButton Key="cmdSend">
<AutoCallBack Command="Send" Target="ds" />
<PopupCommand Command="RefreshCaseSubTasks" Target="ds" />
</px:PXToolBarButton>

Note: While standard actions CreateTask, CreateEmail,... typically redirect to a new page, this approach performs a 'silent refresh' while staying on the same screen.