Full item information of parent item in widget

Hi all,

I want to limit the nimber of items that appear in my widget by filtering the tags of the “isPartOf”-parent item.

The problem I have is below in line visible: = items[0.....

- component: oh-repeater
  config:
    accordionList: true
    fetchMetadata: semantics,widgetOrder,uiSemantics
    filter: '((loop.windowMember.category == "Window") || (loop.windowMember.category == "window")) ? true : false'
    for: windowMember
    fragment: true
    itemTags: OpenState
    sourceType: itemsWithTags
  - component: oh-list
    config:
      noHairlinesBetween: true
    slots:
      default:
        - component: f7-list-item
          config:
            style:
              font-weight: 800
              fontSize: 14px
              margin-top: -7px
            visible: = items[loop.windowMember.metadata.semantics.config.isPointOf].tags.includes("Window")
          slots:
            default:
              - component: f7-chip
                config:
                  bgColor: transparent
                  iconColor: '=items[loop.windowMember.name].state == "CLOSED" ? "gray" : "red"'
                  iconMaterial: sensor_window
                  iconSize: 20px

So I need access to the tags of the parent item that I can retrieve via metadata.semantics.config.isPointOf.
Unfortunately now I’m stuck as items[itemname] only has state and displayState as data.

How can I get more infirmation about the parent widget?
.

Only posibility is to have a repeater within a repeater.
Then you can access both loops.

1 Like

Thanks @hmerk.

Strange idea - and probably a terrible performance but - it works :slight_smile:

- component: oh-list
  config:
    noHairlinesBetween: true
  slots:
    default:
      - component: oh-repeater
        config:
          accordionList: true
          fetchMetadata: semantics,widgetOrder,uiSemantics
          filter: "(loop.windowFilter.name == loop.windowMember.metadata.semantics.config.isPointOf) ? true : false"
          for: windowFilter
          fragment: true
          itemTags: Window
          sourceType: itemsWithTags
        slots:
          default:
            - component: f7-list-item
              config:
                style:
                  font-weight: 800
                  fontSize: 14px
                  margin-top: -7px
                title: "=loop.windowMember.metadata.uiSemantics ? loop.windowMember.metadata.uiSemantics.config.equipment + loop.windowMember.metadata.uiSemantics.config.preposition + loop.windowMember.metadata.uiSemantics.config.location : loop.windowMember.label"
              slots:
                default:
                  - component: f7-chip
                    config:
                      bgColor: transparent
                      iconColor: '=items[loop.windowMember.name].state == "CLOSED" ? "gray" : "red"'
                      iconMaterial: sensor_window
                      iconSize: 20px

Not a strange idea but only possibility.
You know the main_widget code and we are using cascaded repeaters many times just for that use case.

Sidemark, only repeater loops give you full access to all metadata and semantic information. Even item label is not accessible without using a repeater.