Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted

It seems to me the classic way not as expected, What is your experience of this?

 

ex. self:updateView("select_ID_FV", "text", "Select a radio")

 

thx

Posted (edited)
1 hour ago, Krikroff said:

It seems to me the classic way not as expected, What is your experience of this?

 

ex. self:updateView("select_ID_FV", "text", "Select a radio")

 

thx

Please login or register to see this code.

changes the selection. 

to update the text you need to set a new options

Please login or register to see this code.

 

See also the cache bug that affects the option when the user selects it..

 

Edited by jgab
  • Topic Author
  • Posted

    Ok with that but to change the default “Choose” value ?

    Posted
    9 minutes ago, Krikroff said:

    Ok with that but to change the default “Choose” value ?

    Ah, you don't ;-)

    Posted

    So it's nowhere in the property.viewLayout so it must be kept somewhere else...

    Normally the title for a html input select is a disabled first item for the select, so it could have been logical that it was the first item in the options set and that one could disable items...

    Is "Choose" localised? 

    Posted

    @Krikroff did you saw this message :

    Please login or register to see this link.

     

    It appears that the selected item can only be changed if the options have been loaded statically in device's properties, and not dynamically in device's webview using updateView()

    Posted (edited)
    9 hours ago, lazer said:

    @Krikroff did you saw this message :

    Please login or register to see this link.

     

    It appears that the selected item can only be changed if the options have been loaded statically in device's properties, and not dynamically in device's webview using updateView()

    This test updates selected item fine also with dynamically created options... for me.

    Please login or register to see this attachment.

    It works in the Dashboard Web View (with the QA editor view closed), it works on Safari and Chrome on MacOS, and it works in the Yubii app on iOS.

    It doesn't work in the QA editor view with the UI builder - if we update options or select an item there, it is not reflected in the UI builder view - but if we have a another tab open with the dashboard view, it is reflected there correctly... so it seems like the UI builder is buggy when it comes to show current values

     

    Coming back to the menu text label "Choose", it's possible to define when statically defining the UI item, and it shows correctly in the UI builder view, but always shows as "Choose" in the Dashboard view... for me.

    Edited by jgab
  • Topic Author
  • Posted

    Hi @jgab totally agree with you.

    • 1 month later...
    Posted

    @jgab Jan, i have populated my dropdown dynamically, and it is fine, but every time a exit the view, like clicking away to other tab of the QA, it loooses the selected item focus. Always returns back to the default "Choose" option selected.

    Is there anything we can do about this?

    Posted
    1 hour ago, Neo Andersson said:

    @jgab Jan, i have populated my dropdown dynamically, and it is fine, but every time a exit the view, like clicking away to other tab of the QA, it loooses the selected item focus. Always returns back to the default "Choose" option selected.

    Is there anything we can do about this?

    There is no event when a QA looses or gain focus so we don't know when to update the selection.

    The only (ugly) way to do it I guess is to loop every say 2s and set the selection.

    Posted
    11 minutes ago, jgab said:

    There is no event when a QA looses or gain focus so we don't know when to update the selection.

    The only (ugly) way to do it I guess is to loop every say 2s and set the selection.

    The question is, why on earth the dropdown just looses the selected value..it has no sense, anyway thank you

    Posted
    16 minutes ago, Neo Andersson said:

    The question is, why on earth the dropdown just looses the selected value..it has no sense, anyway thank you

    Ah, there is a fix. It seems to be related to the

    Please login or register to see this link.

    and that I reported about...

    In the function that is called when you do a selection, do

    Please login or register to see this code.

     

    Posted
    8 minutes ago, jgab said:

    Ah, there is a fix. It seems to be related to the

    Please login or register to see this link.

    and that I reported about...

    In the function that is called when you do a selection, do

    Please login or register to see this code.

     

    Unfortunatelly doesn't work. It jumps back to Choose.,.

    Posted
    2 minutes ago, Neo Andersson said:

    Unfortunatelly doesn't work. It jumps back to Choose.,.

    For me it works in the Web view on MacOS/Safari. Haven't tested the app.

    Posted (edited)
    On 3/7/2024 at 1:43 PM, jgab said:

    Please login or register to see this code.

    I have tested it on both Yubii application and Firefox or Chrome (Safari is no more available for Windows) and strangely, you need to select twice the same item in the list to have the item name displayed instead of "Choose"

    Even if you select an item in the onInit process it does not work.

    I tried to have 2 updateView in the code and it does not also.

    Edited by Christb
    • 1 year later...
    Posted

    Hi everyone, 

    I'm struggling with this issue as well.

    I can confirm that the only way to have the selectedItem instead of "choose", is to select the same option twice. The fist time you select it the option menu goes back to "choose" and the second time, it remains on the selectedItem.  And self:updateView() cannot help, even when it's called several times.

    This is abnormal and very annoying.

    Has anyone found a workaround or a fix ?

     

    Posted

    I actually found a workaround by trying all kind of combinations !


    Using tostring() on event.values[1] in self:updateView() did the trick !

    Please login or register to see this code.

     

    Does it also work in your case ?

     

    Posted

    It was always known, that you have to use string for the value you want to apply. Look at the Jgab's, or Krikroff's examples..All have quotes..

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...