Hide input elements

Ok, next question.

How can I show and hide input fields in a custom app? I know somebody had discussed a workaround several months go, but I can’t find it. I believe in that case it was hiding advanced features in an app or driver.

You just need to put the input inside an if condition. Usually people will use a boolean like showAdvanced for example to reveal multiple fields.

1 Like

Wouldn’t that just be for page load? What if you want to toggle something open and closed?

My last pass at a lighting controller had some custom code that was loaded in the child objects. This started to get a bit tangled and I wanted to pull out the special conditions. So each room may now be setup from a table.

One of the bits of spaghetti code was due to my lights. I have some that use RGB but most use the typical HSL. I want to be able to just show the settings for the specific style.

So I can set the toggle, save, and reload since it is just for me. If this were a mainstream app I would be more worried about making it dynamic.

Edit: The above clip is working like you suggested. I would just prefer if it were dynamic.

Are you looking for submitOnChange: true to effectively make the page reload whenever an input with this parameter specified is changed?

Hmm, let me take a look at that. Still would like a show/hide but I can live with a reload.

You can show/hide with if/else, as suggested above--the whole page will be reloaded so your expressions will be evaluated--unless I'm misunderstanding something.

From your screenshot above and a reasonable guess about what you probably want, the combination of these two things sounds like it will do what you want.

Most controls have submitOnChange true, which basically means the page is reloaded after every change. So, if you change a control any conditional values will be re-evaluated and you can use that to show or hide any controls you want.

1 Like

OK, that works better than expected. I thought the whole page would go blank and redraw.