Conversation
| def compute_definition(trame_dataclass_class): | ||
| client_only = getattr(trame_dataclass_class, "CLIENT_ONLY_NAMES", []) | ||
| template_fn = getattr(trame_dataclass_class, "template", None) | ||
| template_str = template_fn().html if template_fn else "" |
There was a problem hiding this comment.
FIXME ! => need to provide server for properly handle trigger registration when using several servers.
There was a problem hiding this comment.
Should be able to make it brake by using the non default server...
There was a problem hiding this comment.
I tried with a child server and indeed it does not work, it even breaks silently
There was a problem hiding this comment.
Can you share your example that break it? That way I can make sure I fix it.
There was a problem hiding this comment.
I used this main in examples/gui/contacts_embeded.py:
def main():
main_server = get_server()
server = main_server.create_child_server(prefix="child_")
app = AddressBookApp(server)
app.server.start()
There was a problem hiding this comment.
Wow that was a tricky one and was caused by several things.
- what I was talking about was related to the template (str) generation and making sure a server and ideally the proper one was getting used for registering trigger name. And it happen that in the context, because the main UI was generated before, the used server was getting cached and was getting assigned when the template was generated. I changed that to pass the server from the protocol that requested that template.
- What you ran into was about template replacement for variable name and there was 2 issues
a. the variable extraction was not working because we were not using?as a separator. Thereforeselected?.[0]was not tokenized toselected.
b. when the js_expression translation was happening thesetdefaultonselectedwas not happening and therefore no translation tochild_selectedwere happening. So on exit of thewith, I now flush properties to apply defaults on the state.
There was a problem hiding this comment.
| def compute_definition(trame_dataclass_class): | ||
| client_only = getattr(trame_dataclass_class, "CLIENT_ONLY_NAMES", []) | ||
| template_fn = getattr(trame_dataclass_class, "template", None) | ||
| template_str = template_fn().html if template_fn else "" |
There was a problem hiding this comment.
I tried with a child server and indeed it does not work, it even breaks silently
No description provided.