Reputation: 907
Currently I have an unbound DAC which is acting as a filter in a processing screen. Some of the values in the filter are being modified in a field updated event. The problem is even though I am executing the RequestRefresh function the UI does not display the updated values of the DAC. I also tried calling the View.Clear() function before executing the RequestRefresh to no avail.
I also have another scenario, where in a grid I have a selected checkbox in which only one item at a time can be selected. Here is the implementation:
protected virtual void DCCrCaseAssignedBenefits_Selected_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
DCCrCaseAssignedBenefits row = (DCCrCaseAssignedBenefits)e.Row;
if (row != null && !(bool)e.OldValue && (bool)row.Selected)
{
foreach (DCCrCaseAssignedBenefits item in cache.Updated)
{
if (item.Selected == true && item != row)
{
cache.SetValue<DCCrCaseAssignedBenefits.selected>(item, false);
}
}
CaseAssignedBenefits.View.RequestRefresh();
}
}
This code excerpt was taken from Acumatica and then modified for my DAC but even though the graph only has one selected item at a time, the UI does not refresh and give the impression that there are multiple items selected.
Upvotes: 0
Views: 1305
Reputation: 5623
What if you try cache.Update(item) in place of SetValue?
Something like this in your foreach loop...
if (item.Selected == true && item != row)
{
item.Selected = false;
cache.Update(item);
}
If this doesn't help, can you include your aspx/grid? I assume the issue is in the grid values updating vs the filter updating in the UI?
Upvotes: 0