It is possible to update a page automatically with "refreshInterval", but that can be a bit annoying when there's input fields on that page.
Is there a way to automatically only update a specific input field, like an enum options list.
I have an options list being created in the background, it's a device discovery, so it can take a few minutes at times. While using refreshInterval on a dynamicPage can auto-populate all fields, it is not optimal since there are other fields the user may be writing settings to, like the new device name.
Yes, I could probably solve this in some hacky way overriding Handlebars with some of my own JS, but that is not what I'm asking, is there an OFFICIAL way of doing this? I can't find one, but I'm hoping it's just me being new to the platform.
Another way would be to redesign the flow of the app and have the user input on another page after this refreshing page, but I would prefer not to do that.
This is the page being refreshed once every 20 seconds:
You can refresh the ‘input’ by adding:
submitOnChange: true
As part of the input statement
As soon as something is entered into the input and you click away then it is refreshed
Andy
Thank you, yes, but that happens based on user interaction, not updated automatically. It does update the options once I leave the field, but not automatically. I actually do have submitonchange set on all fields to keep the values on page refresh.
If there is nothing like the auto-refresh of dynamicPage but just for a specific input, I guess I will have to separate the input to a second page and just refresh this one until all devices have "arrived".
I’m sorry, I misunderstood.
I would split it up and do the discovery on a separate page before moving on to allowing user input.
Andy
Ok, then I will do that, otherwise the user have to be quick, no more than 20 seconds before leaving a field to save... Otherwise the changes are lost. Thank you, at least now I know that I didn't miss some feature that can do this which was mentioned somewhere in a post I've never read because it's from 2018...
If you look at the way some in-built apps work.
For example the sonos integration... it will do the discovery before allowing selection etc
Perhaps not the best example, but you get the idea
I know, I did look, I just didn't want to I wanted to be different... But not at the cost of having to resort to JS. So splitting it up is the only way to do this and for it to remain "neat", so that is how it will be.
How about a “refresh list” button the user can click?
I want it to refresh automatically so that the user can see when the devices are available without clicking anything. I'll probably use that type of button in other parts of the app though.
I presume you are doing this because you are doing some background discovery and want the field to refresh. I would suggest using the same design pattern that other apps use for this, using a "wait" page while the discovery happens. It will offer a user experience that is both consistent with other apps while at the same time being more user-friendly.
I say user-friendly because, what happens if nothing is discovered? The user gets a blank drop-down, with no feedback as to where the process failed. How does that failure condition get presented to the user or are they left to wonder why there's nothing to select?
Not trying to criticize your creativity, which I applaud. Only trying to point out some of the unintended consequences.
I know, I had intented to do something that works like that but once device where detected show the input fields. It doesn't work well with the refresh function, so since there was no, reasonable, way around that, I did what is "expected".
There would have been info in the dialog, but anyway. I do appreciate the feedback though. In the end I did this:
EDIT: Thank you @cobra, @srwhite and @jwetzel1492 for your feedback, in the end I did end up doing it the way it is "supposed" to be.