Formatting output of "actionGroupPopupItem:" Popup

Hi All.

I am using the following in a widget:

          - component: oh-label-item
            config:
              visible: =items[props.partitionPrefix+"_Bypass_Group"].state != "-"
              action: group
              actionGroupPopupItem: =(props.partitionPrefix) + '_Bypass_Group'
              item: =(props.partitionPrefix) + '_Bypass_Group'
              title: =(props.partitionPrefix) + ' Bypass_Group'

I would like to be able to format the resultant Popup:
Bypass Popup

Specifically to remove the Icon as highlighted. But would also like to add colour and visibility - work in progress.

I cannot work out where to add the required details.

Any suggestions?

Thankls
Mark

I don’t think you can alter the default group popup too much. But it would be easy enough for you to create your own custom popup using the itemsInGroup source for a repeater.

1 Like

Thank you. Will give that a try…
From what I can see, please correct me if I am wrong:
I would need to create an external widget containing the itemsInGroup repeater and then link to that via:

 - component: oh-button
   config:
      text: BYPASS
      action: popup
      actionModal: widget:BypassCard

Thanks - you always sop insightful.

EDIT: - I am using variables in the main widget to allow me to configure properties on the fly… Don’t think the variables will get passed to the secondary widget?

If you want to create you own card to display on some other page then this is what you would do. However, you don’t need to go through all that trouble if you just want the lists on the overview tabs to look a little different. In that case you only need to create the single list-item widget which you can then set to be the widget that is used in the lists that are automatically created on the overview page. See this link here for several examples:

I am actually trying to create a complete widget for an alarm system…

So when I press the BYPASS button I want it to popup a list of all the Zones with the ability to SWITCH each one to bypass it.

Works with the actionGroupPopupItem option - however cannot format the output.

I can get the popup to appear - however nothing is displayed as the variable does not seem to be passed to the popup?

The following is what I am getting with popup vs the actionGroupPopupItem - would like to be able to get rid of the icons (and letters) and format the colouring etc

The following is what the widget gives if provied the correct variable:

Thanks
Mark

Custom default list widgets should show up in the groupItem popup as well as I believe. So you could continue to just use that group action and get the formatting you desire. The only downside, if you care, would be that you can only define one custom list widget per item so if you want to see different displays in the overview tabs lists and this alarm widget then you do have to build this widget from the ground up.

Managed to get a working solution passing the .props between two widgets:

Called with:

    - component: oh-button
      config:
        text: BYPASS
        action: popup
        actionModal: widget:BypassCard
        actionModalConfig:
          partitionPrefix: =items[props.partitionSelection].state

to widget:

uid: BypassCard
tags: []
props:
  parameters:
    - description: partitionPrefix
      label: partitionPrefix
      name: partitionPrefix
      required: false
      type: TEXT
    - context: item
      description: An item to control
      label: Item
      name: item
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Apr 26, 2021, 10:06:02 PM
component: oh-list-card
config:
  title: Zones Bypassed
slots:
  default:
    - component: oh-repeater
      config:
        fragment: true
        for: item
        sourceType: itemsInGroup
        groupItem: =(props.partitionPrefix) + '_Bypass_Group'
      slots:
        default:
          - component: oh-toggle-item
            config:
              title: =loop.item.label
              item: =loop.item.name
              color: '=(items[loop.item.name].state == "ON") ? "red" : "gray"'

Thanks for the hints etc.

1 Like