Is there an option to prevent the view from being rebuilt on the change of an input?
We have many inputs, only a few of those are used for the view. Whenever an input field is changed, the view is redrawn. I find this rather distracting and would like the view to remain as it is on inputs in certain fields, while inputs in other fields should redraw the view.
2 Likes
Hi @thomasvdl ,
Unfortunately there are only two options:
duration_guess < 3: This causes the view visible to refresh after every trigger event.
duration_guess > 3: This presents a button in the right-bottom corner with a default label “Update”. This label can be defined with the argument update_label.
E.g.
@vkt.ImageView(“My image view”, duration_guess=5, update_label=”Render image”)
def get_image_view(self, params, **kwargs):
…
return vkt.ImageResult(…)
Will mark this as a feature request to be able to only recalculate view when changing specific inputs
1 Like
In general it would be nice to be able to pin a view to specific input fields
Do I understand it correctly that in this case you would like to annotate for which params the view sould be redrawn?
Yes in my case default behavior should be reload whenever any param changes.
However in many cases a list of keys (param keys) could be provided which keys should be checked for changes.
Lets say an app has 5 Pages/Steps. The first view is a static PDF view. It should never reload, only load once.
A simple summary view, maybe required 2-3 input fields, so all others are relevant.
While some pages might require all but a few to generate.
So in short:
Optionally give a list of keys to each View of which params to check.
Empty list means, don’t reload.
None means: check all params (current behavior)
Sounds good to add a list of params to check, but I think it would mean it’s not compatible with earlier versions. Therefore I would add a list of params to not check, or add an extra attribute in the parametrization.
I agree it would make more sense to specify which params should not cause a reload. The default behaviour is that any change in params causes a reload, so I think it makes sense to specify the exceptions to the rule (and not the other way around).
This would also enable things like not causing a reload upon questions with a vkt.Chat. This would be really useful for us!
1 Like