Hope that makes using expressions here a bit clearer. Maybe we should put some interesting examples together how to use expressions and where are the pitfalls.
btw, for anyone how would like to some very interesting examples on how to apply expressions and use various attributes you should see Rainer’s Weather Widget (Kudos to you, @RGroll ). At least for me a very good learning foundation…
In the expressions section is it worth adding a simple stacked example and a reference to the widget expression tester . What is the protocol on editing?
Me again…
as I thought I had understood it I went on and tried to apply my knowledge on the “visible” attribute similar like I have seen it in examples of the weather widget and discussed above:
If the page is still a wiki, go edit it and leave a comment describing what you changed.
If not, file a PR on the page in the github repo. I’ve written and rewritten the Pages tutorials here several times and am still not satisfied so these parts of the Getting Started Tutorial are still open for contributions here.
The oh-plan-marker component seems to not support the visible: property - if you see a usecase for this, it’s worth opening a enhancement suggestion for this on github
Thanks for the research Rainer, I would have even known that I am using that type of component.
Yep, the idea is to make items appear and disappear depending on a state or in my case I wanted to make the icon blink in case of an alarm. The only idea I have to make it blink is to switch icon images.
I probably ask for this to be added to the component.
The way I solved it is by toggling between the “oh:alarm” and and empty one: “oh:none”.
You can change the visibility of an component with classes as well. So if the visibility attribute is not available use the class display-none. See my example:
it seems the oh-plan-marker also doesn’t support the classes attribute. As you can see the alarm-icon is still shown although the expression does compute “display-none” :