-
I'm flowing this page https://dev.writer.com/framework/page-routes but that doesn't seems work. I have used it in a handler. The UI is completely CMC. Is anything I'm missing ?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @am007! Mind sharing a snippet of your UI code? One hint I would suggest is to check whether the CMC pages have a defined As an example, this won't work: with wf.init_ui() as ui:
for page in range(1, 4):
with ui.Page(id=f"test-cmc-{page}"):
ui.Text({"text": f"Hello Page {page}!"})
for page_link in range(1, 4):
if page_link == page:
continue
ui.Button({"text": f"Go to Page {page_link}"}, handlers={
"wf-click": {1: page_1, 2: page_2, 3: page_3}[page_link]
}) but this will: with wf.init_ui() as ui:
for page in range(1, 4):
with ui.Page(content={"key": f"test-cmc-{page}"}, id=f"test-cmc-{page}"):
ui.Text({"text": f"Hello Page {page}!"})
for page_link in range(1, 4):
if page_link == page:
continue
ui.Button({"text": f"Go to Page {page_link}"}, handlers={
"wf-click": {1: page_1, 2: page_2, 3: page_3}[page_link]
}) |
Beta Was this translation helpful? Give feedback.
Hello @am007! Mind sharing a snippet of your UI code? One hint I would suggest is to check whether the CMC pages have a defined
key
incontent
dictionary in addition toid
component property – it is slightly counterintuitive, but pages would not be accessible otherwise, asid
is what we use to "store" it on backend, andkey
is what frontend uses to manage display.As an example, this won't work: