-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binding don't seem work inside a repeater #26
Comments
The documentation should be clearer, thanks for reporting this. This is expected behaviour though, as you cannot bind to context, only to state. You can create an event handler using state and context to achieve this. There's an example here at the bottom Thank you for trying Streamsync and providing feedback. Let me know if I can help. |
Best @ramedina86, How does this work using a slider inside a repeater? Binding does not work as you mentioned above, so how would a default value be set? This is my handler function and it works: def handle_set_chunk_size(state, context, payload):
name = context["itemId"]
state["loaded_documents"][name]["chunk_size"] = payload But when initializing the repeater the slider has no value: Binding it directly to for instance Kind regards, |
Hey Caspar, this is a great point -thanks for bringing it to my attention. I'll reopen the issue. It'll be quite challenging to implement this, but worth it. |
Hey @ramedina86, Has a fix for this been implemented already? Or a temporary work around that you can think of? Best regards, |
Hi @Capsar not yet, though it hasn't been forgotten, it'll be implemented before the end of month. |
Hi @Capsar it's now possible (v0.2.8) to bind inside a Repeater using dynamic accessors, providing the functionality you detected was missing and some more. For example, This also gives you the chance to use |
How is this supposed to work? Is this JUST for the binding of components to items in the repeated items. Using your example from the docs (hint...you may want to update the docs for this use) articles[itemId].colour Could be bound to some dropdownselect or some other input, so a user could SET the colour to some value and it will be updated in the state for "articles"? For display we still use
Could be somewhat confusing to use two separate notations, but I guess the point for this is that now you could do something like otherstate[itemId].someattribute and set an attribute in some other state item, here now "otherstate".
|
(Two way binding like inputs)
It seems that it doesn't differentiate them.
The text was updated successfully, but these errors were encountered: