jonadev95
jonadev95

Reputation: 367

wirecloud / fiware widget adding list to preferences

I'm working on a widget in the fiware lab and I want to use the the list option in the preferences. I used text, boolean and number before, but there isn't documented how to define the options.

How could I do that? In the config.xml? Is it an array or something else?

Upvotes: 1

Views: 96

Answers (1)

Álvaro Arranz
Álvaro Arranz

Reputation: 2035

You are right there were not documentation about how to add list preferences, thanks for reporting it. We have improve our "Adding preferences" tutorial wiki page to include more details on how to define list preferences and soon those changes will be included on other guides and on the FIWARE's E-learning platform ;-).

Anyway, here is an example of how to define a list preference including their options:

<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="Wirecloud" name="Test" version="1.0">
  <details>
    ...
  </details>
  <preferences>
    <preference name="list" type="list" label="list" description="list preference" default="default">
      <option value="default" label="Default value"/>
      <option value="1" label="value1"/>
      <option value="2" label="value2"/>
    </preference>
  </preferences>
  ...
</widget>

Upvotes: 2

Related Questions