• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

trying to refresh a grid after changing a AppVar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • trying to refresh a grid after changing a AppVar

    Hello Team,
    I have been unsuccessfully trying to get a widget to refresh with a button helper program. The widget has a custom filter on it that uses a App Var. I thought if I update the App Var with the button program, and use SetResponse('refresh':'true'); the grid would update with the new filter. Am I wrong?
    the custom filter is this,
    let filter = getTo('EEEMPN') + ' in (' + getAppVar('traineeList') + ')';
    return filter;
    EEEMPN is the field and the traineeList is a string of employee numbers separated by commas. It works the first time the grid is loaded. I have a column icon on each row and on click, I'm running an RPG program that changes the traineeList (technically removes an employee number from the list). I just can't get it to do what I was hoping for. Any ideas?

  • #2
    When a widget is refreshed we don't regenerate the filters that were previously set because majority of the time it's based on a record from a clicked widget to filter another widget

    I would recommend the button program fire an event and add an event listener in behaviors for that event. That listener would filter your widget like you're doing today pulling in the app variable that was set from the backend. No need to do the SetResponse('refresh':'true') since the filtering of a widget reloads its data


    Screen Shot 2023-02-07 at 6.47.39 PM.png

    Hopefully that makes some sense

    Comment


    • #3
      That works, Thanks Jonny.

      Comment

      Working...
      X