[OH3] How can I define a dropdown list in a page

Hello all,

I am migrating to OH3 since a couple of days and really start valueing the new release. Moving away from my file based OH2 config to UI based config is quite some work, but I really enjoy it.

Unfortunetally I struggle to implement a very simple requirement in pages. I would like to have a dropdown selection list, which allows me to select one entry out of a list. This shall be then used with exec binding to execute a script with the selected attributes.

I selected the input list widget, but I simply do not understand where to put in the list of selectable values. I also looked at Input Vue Component | Framework7 Vue Documentation . But as I am not very experienced in coding and the F7 docs use a syntax differnt to the openhab YAML, I am not getting further.

I am pretty sure it should be very easy, maybe someone can help. Attached my YAML code.

Thanks in advance for any advise.

config:
  label: Test1
blocks:
  - component: oh-block
    config: {}
    slots:
      default:
        - component: oh-grid-row
          config: {}
          slots:
            default:
              - component: oh-grid-col
                config: {}
                slots:
                  default:
                    - component: oh-list-card
                      config: {}
                      slots:
                        default:
                          - component: oh-input-item
                            config:
                              type: select
                              placeholder: bitte auswählen
                              title: Title
                              subtitle: subtitle
                              icon: oh:presence
                              sendButton: true
                              option: INput 1
                              value: TEEST123123, sdfsafs
                              defaultValue: tetst
                              name: value:sdfsaf
                              item: sudowebscript_input
                            slots: null
masonry: null

Example :

                    - component: oh-list-card
                      config: {}
                      slots:
                        default:
                          - component: oh-list-item
                            config:
                              title: Test
                          - component: oh-list-item
                            config:
                              title: Test2

Thanks @bhomeyer , but I am trying to achieve something like here:

After clicking the selection list shall appear

Are you looking to do this in a sitemap(for mobile and such), or in the MainUI for display on a tablet or something?

in the main UI, I would like to have this on my overview page. So far I achieved to have adropdown, but I can not put in the selection items.

So, finally I found a solution - pretty easy one.

  1. Put the options I want to select into the Commad Options Metadata of the item
  2. Used Label cell, and selected command options as the action.

Maybe it helps someone who has the same question

4 Likes

Hi @madattack ,

May I ask how you linked to the item-index?
I suppose you created your own widget with an item input?

Could you please share?

Best regards,

Hi @tjarco,

Sorry for the late reply. I just selected command options in the actions section of the standard Label cell widget.