Trigger - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki
<TRIGGER/> : Widget
<TRIGGER/> is called by an event and performs like a if(default), type == 'multi' / elseif, type == 'single'. Trigger takes children of <CASE/>.
- The
<CASE/>
clauses happen in an ordered sequence.
Name | Type | Default | Description | Req |
---|---|---|---|---|
type | string | multi |
single or multi . Single will trigger the first true case. Multi will trigger every true case. |
Name | Type | Default | Description | Req |
---|---|---|---|---|
when | bool | null | If the case is triggered, can be an eval that returns a value. | |
call | Event String | null | A string of events that will execute once the case is true. |
Example
<FML>
<CENTER>
<TRIGGER id="pop" type="multi">
<CASE when="={pineappleonpizza} == true" call="reward.set(':pineapple:')" />
<CASE when="={pineappleonpizza} == false" call="reward.set(':pizza:')" />
<CASE when="=!noe({pineappleonpizza})" call="toast('Thank you for your input');" />
<CASE when="=noe({pineappleonpizza})" call="reward.set(':angry:')" />
</TRIGGER>
<TEXT style="caption" bold="true" size="32">Settle a debate</TEXT>
<SELECT id="pineappleonpizza" onchange="trigger('pop')">
<OPTION value="" label=""/>
<OPTION value="true" label="Yes"/>
<OPTION value="false" label="No"/>
</SELECT>
<TEXT id="reward" size="64" value="" />
</CENTER>
</FML>