Read actionoptions dynimically from item definition

Hi,

I have a widget that uses the actionoptions config. Is there a way to read this out from the item definition itself? Is there a docu to know what one can use? I just now state and displayState; probably more available.

Code snippet:

- component: oh-link
    config:
      style:
        margin: 0 0.5em
      iconF7: music_house_fill
      iconSize: 18
      color: gray
      round: true
      action: options
      actionItem: =props.groupingList
      actionOptions: "Esszimmer + Küche=Esszimmer + Küche,Esszimmer + Küche + Wohnzimmer=Esszimmer + Küche + Wohnzimmer"

Thanks and best

From the docs:

action: options provides the ability to send a command from a list of options. Options are displayed at the bottom of the screen when the button is clicked. Options are specified either in the actionOptions property or if this is omitted from the Command Options metadata specified on the item.

The important part here is that the options that are stored with the item are stored in the “Command Options metadata”. This means that you do not have any access to them in the usual widget expressions because the items object only carries the state, displayState, and state type information.

The one exception to this is if you are working within a repeater that has used one of the types of array that is a list of items (e.g., itemsInGroup). In that case what gets returned by the repeater is the complete item information as returned by an API call. You can also add a request for metedata to the repeater using the fetchMetadata option which could then return the metadata for the command options for the items in that list.

In reality, API calls like the repeater itemsInGroup are a bottleneck for the UI. Too many on one page and you will see a noticeable drop in performance (this is partially why the items object is a bare-bones as it is). So, if you’re going to use this only once on a page then go ahead and setup a repeater that calls just the one item of interest (either put that item in its own group or give it a unique tag) and then you will have access to the metadata. If you’re going to use it a lot on one page then you will want to spend some time thinking about how to reduce the number of API calls by combining the many widgets under a minimum number of repeaters (ideally 1).