Another workaround was my idea to change the properties of a component from inside the component but you can’t change properties from inside
mybe this is even correct not to overwrite external inputs but with these limitations I would still need an external global variable just to control a accordion which is a big bummer…
I think about forgetting components until they are kind of usable…
I want a collapsable element. These are in a repeater. It simply hides/shows an internal other div by changing an internal variable “opened”
So far so good. Manually open and close the element works by change opened variable on click of a button and display the other button.
But I also wanted to control the opening state from outside as if a user adds a new element It should open the container by defaut. For that I created a property “opened_external” to control the state from outside.
But then I can’t control it manually any more.
I can bind the open state to: opened || opened_external
But I can’t bind the visibility of the show/hide buttons to that behavior:
one button shows on : opened || opened_external
but the other button has to show on: !opened || !opened_external which is wrong
And I can’t change the parameter on an internal workflow to get rid of one variable. And I can’t change the internal variable to the property as I don’t have the possiblity to bind the default value of the variable to the property…
Yes the task is simple. A collapable container as a component that can be controlled manually and from outside.
Not possible as it seems…
With component actions it would be no problem. But there I also would need to access a component action in a repeated component. Same with exposed variables. I would need to change a repeated external exposed variable…
As least I get it kinda working:
“but the other button has to show on: !opened || !opened_external which is wrong”
!(opened || opened_external) works
still a hassle
And I am in front of the next problem not able to change the opened_external parameter on the inside after the user saved the element… grrr… therefore I would still need a global state… mäh…
I give up and work without components and keep going with global states…