+1
Create Tag Help
How do you make a create action that will make a panel every time it is pressed?
I want to make a button that will create a new panel every time it is pressed that has new attributes. Each panel needs to have its own actions as well.
I want to make a button that will create a new panel every time it is pressed that has new attributes. Each panel needs to have its own actions as well.
Servicio de atención al cliente por UserEcho
Then on your button you can add an onclickup to trigger an action that will create your class. A create tag essentially takes the place of the object tag when using classes.
Because you require that your created panels have different content, you may have to determine several different create tags and wrap them in a randomgroup tag within your action to allow for different panels to get created at random.
<wire>
<classes>
<class name="panel">
<panel name="[param:name]" width="100%" height="100%" onclickup="[param:action]"></panel>
</class>
</classes>
<main>
<panel name="button" width="40" height="40" background="ff0000" onclickup="create"></panel>
<panel name="container" alias="CONTAINER" width="90%" height="90%" valign="bottom"></panel>
</main>
<actions>
<action name="create">
<randomgroup>
<create class="panel" name="1" onclickup="action1" target="CONTAINER"/>
<create class="panel" name="2" onclickup="action2" target="CONTAINER"/>
<create class="panel" name="3" onclickup="action3" target="CONTAINER"/>
</randomgroup>
</action>
</actions>
</wire>
If you don't want your panels to overlap, consider putting them into a pager when you create them, that way they will fall in line.