Idea: Update of merge fields in labels with changes in the model

  • 4
  • Idea
  • Updated 3 days ago
  • Planned
I have tab labels that uses merge syntax to display the total number of records in a model. When I update and requery that model using action framework, the label does not update so the total number of records shown in the tab label is inconsistent with the number of actual records displayed in the table within that tab. It would be nice if there was a way to trigger update of merge variable values upon requery.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb

Posted 3 years ago

  • 4
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
yes!
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Raymond, as a temporary work-around I usually run a one-line snippet right after the query, which looks something like this:

skuid.$C('MyComponentId').render();
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Tabsets are not tied to a model, which is the reason they don't re-render automatically on your query.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
You are the best! Thanks
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
You are still the best, but I am now realizing that due to the number of components that I do this on and the number of action sequences that lead to updating of models tied to these merge variables on those components, I would have to add this action about 32 times just for my one page. Obviously, it would be preferable if Skuid could know to update them automatically. In the short-term.... Time to get to typing....
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Actually, I'm rethinking it. I should be able to do a model action that updates the components on requery of the model. That bypasses each individual action sequence so I should only have to do it once per model.
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Gentlemen~

Raymond, this is an interesting idea. I'll bring it to the team and see what they think about including this in a future release.

Matt, thanks for your snippet workaround! Glad it works for Raymond in the meantime!  

Thanks!
Karen
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
In the upcoming Brooklyn release, global merges, such as {{$Model.Account.data.length}} will automatically update when the number of records in a Model changes. This will address the principal concern here, where folks are using global merges in Tab labels to show the number of records in the Model whose data is shown in a tab.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Hi Zack,
I am now on 9.5.5 and I am still not seeing this updating behavior. As an example, I have a tab with a label of
Service Requests ({{$Model.ServiceRequestDashboard.data.length}})
The length does not update when I apply table filters or query the model through actions.
Photo of Korey

Korey

  • 1,108 Points 1k badge 2x thumb
Did this ever get resolved? It seems like the problem still exists.
Photo of Chris Mollan

Chris Mollan

  • 570 Points 500 badge 2x thumb
okay, thanks.  Any workaround until then?  I am trying to use this to update the tab label

skuid.$C('sk-1xt3wk-1107').render();

It works for template id's but not for tab ids?