just getting into the Pages/Widgets feature. Just created a floorplan with markers. Clicking on them opens a popover. Now the following question: is there a way to pass a variable (or something like name of marker calling the popover would be enough) to the popover? I have a few markers showing different values. Clicking on them should open a popover which allows to do some settings (matching the markers corresponding items). It would be easy to create a own widget for each marker but isn’t there a better solution?
ok already figuerd it out after re-reading the wiki-pages here for the 6-time. Got it working with Yannick example of the keypad. (did try it similar way already but did not work but with the example its clear) If someone encounter same:
ex. use this inside the config part of a marker etc.
define inside the widget under the “props/parameter” label your item like
- context: item
description: An item to control
label: Item
name: item
required: false
type: TEXT
and use it inside your widget like
=items[props.item].state
So i can now finally have a multiple marker which open (when clicking on them) a popover using already the right item (with only one widget)
Once you get into the YAML and understanding it, it’s getting simpler every time. I like it.
//EDIT:
You can also set more items. Just use the item-name you set (unde props in your widget) inside the actionModalConfig like:
Chart pages are still largely ignoring expressions so props wouldn’t be useful anyways.
But that’s something that would have to be improved in the next months, so you could have “generic” pages with props and e.g. open them in an action context, in a popup or even standard navigation, with the prop values assigned by the “caller”.
It’s been planned from the start but still needs work.
That’s why the description of the target props when you select a page-or-widget-related action hint at pages defining props too.