Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MainUI - Sitemap Pagedesigner] Wrong type "number" for list separator in Designer #949

Closed
DarkC35 opened this issue Mar 10, 2021 · 0 comments · Fixed by #950
Closed

[MainUI - Sitemap Pagedesigner] Wrong type "number" for list separator in Designer #949

DarkC35 opened this issue Mar 10, 2021 · 0 comments · Fixed by #950
Labels
bug Something isn't working main ui Main UI

Comments

@DarkC35
Copy link
Contributor

DarkC35 commented Mar 10, 2021

The problem

Sitemap pagedesigner widget uses wrong type number for control Separator. Therefore a correct separator for a list widget (like ,) cannot be set via the designer. It is possible to set the separator via code (see screenshot below) but the set separator will not be displayed in the designer (and a following change+save of the separator with a string/text in the designer results in an unset of the seperator in the sitemap code... i guess because of validation?).
grafik

Expected behavior

Control separator should have type text so it is possible to set the separator with the designer too.

Steps to reproduce

  1. make a sitemap (Settings -> Pages -> Create Sitemap)
  2. add a list widget
  3. try to set separator , in designer
  4. save the sitemap (no error occures and separator is still visible in designer)
    grafik
  5. switch to tab Code
  6. no separator prop was added in sitemap code
    grafik
  7. switch back to tab Design
  8. separator , disappeared
    grafik

Your environment

runtimeInfo:
  version: 3.1.0
  buildString: "Build #2211"
locale: de-AT
systemInfo:
  configFolder: c:\openhab\conf
  userdataFolder: c:\openhab\userdata
  logFolder: c:\openhab\userdata\logs
  javaVersion: 11.0.6
  javaVendor: Oracle Corporation
  javaVendorVersion: "18.9"
  osName: Windows 10
clientInfo:
  device:
    firefox: true
    os: windows

Additional information

The problem seems to be in this line:

<f7-list-input v-if="supports('separator')" label="Separator" type="number" :value="widget.config.separator" @input="updateParameter('separator', $event)" clear-button />

ListRenderer in BasicUI uses getSeparator() to split the string

for (String row : state.toString().split(((List) w).getSeparator())) {

and according to openhab-core separator is of type string:

https://github.com/openhab/openhab-core/blob/4a79e9bfe7dca9f6abd1e40d3eb398a9aa2c8988/bundles/org.openhab.core.model.sitemap/src/org/openhab/core/model/sitemap/Sitemap.xtext#L104

I'm willing to submit a PR that fixes the wrong type in the widget-details.vue file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant