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.
The config part (i.e. the stuff in [ ]) is an array of key/value pairs. Metadata is not recursive so you can’t put separate metadata inside the config.
It should be possible to define in .items files. But I don’t really support .items files any more (far more time is wasted solving syntax errors that are impossible to make in the UI than any perceived benefit from using .items files) so have few further ideas. All I can say is
Syntax
Correct
actionModalConfig=""[
Definitely Wrong
actionModalConfig[
Definitely Wrong
actionModalConfig=[
Possibly Correct
If it still doesn’t parse, there is something else wrong with the syntax.
The [ ] denotes an array. The value for a key/value pair in metadata config should allow an array. However, you are not actually defining an array here but a map. So maybe if needs to be actionModalConfig={...} instead. I’ve no ideas beyond that.