Skip to content

updated_{variable_name} not firing #290

Answered by adamghill
zurtri asked this question in Q&A
Discussion options

You must be logged in to vote

And you have a new_event_horse field in your component? I was testing in my example with your HTML above and this basic component code:

class TestView(UnicornView):
    horses = [Horse(1, "Horse 1"), Horse(2, "Horse 2")]
    new_event_horse = ""

    def updated_new_event_horse(self, value):
        print(f"updated_new_event_horse value: {value}")

and I'm seeing those print statements in my terminal:

What I didn't realize is that the method actually gets called twice (once for the original value and then a second time for the new value, which seems a little weird to me). But, let me know if I can help troubleshoot in another way.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by zurtri
Comment options

zurtri
Oct 7, 2021
Author Sponsor

You must be logged in to vote
1 reply
@adamghill
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants