Emulate a form
Release variables coming from different inputs, in one shot.
{
'title' 'My Dashboard With events'
'cellHeight' 90
'vars' {
'myVar1' 'a'
'myVar2' 'b'
'myStruct' { 'myVar1' 'a' 'myVar2' 'b' }
}
'tiles' [
{
'type' 'input:text'
'title' 'myVar1'
'w' 2 'h' 1 'x' 0 'y' 0
'macro' <% { 'data' $myVar1 'events' [ { 'tags' [ 'myVar1' ] 'type' 'variable' 'selector' 'myVar1' } ] } %>
}
{
'type' 'input:text'
'title' 'myVar2'
'w' 2 'h' 1 'x' 0 'y' 1
'macro' <% { 'data' $myVar2 'events' [ { 'tags' [ 'myVar2' ] 'type' 'variable' 'selector' 'myVar2' } ] } %>
}
{
'type' 'button'
'title' 'Emitter'
'options' {
'button' { 'label' 'Send' }
'eventHandler' 'type=variable,tag=myVar(1|2)'
}
'w' 2 'h' 1 'x' 0 'y' 2
'macro' <%
{
'data' <%
{ 'myVar1' $myVar1 'myVar2' $myVar2 } 'myStruct' STORE
{ 'data' $myStruct 'events' [ { 'tags' [ 'myStruct' ] 'type' 'variable' 'selector' 'myStruct' 'value' { 'myStruct' $myStruct } } ] }
%>
}
%>
}
{
'type' 'display'
'title' 'Event var receiver'
'w' 10 'h' 3 'x' 2 'y' 0
'macro' <% $myStruct ->JSON %>
'options' { 'eventHandler' 'type=variable,tag=myStruct' }
}
]
}
Found an issue on this page or something missing?
Tell us onThe Lounge, the Warp 10 Community Slack.