Anyone who can write an APL function should be able to host it on the web.™
Rendered webpage |
APL code |
:Class ejCheckBoxAdvanced: MiPageSample
⍝ Control:: _SF.ejCheckBox
⍝ Description:: Callback interconnect two checkboxes
∇ Compose;n
:Access Public
⍝ We create an unchecked Syncfusion check box with caption 'Check Me!'
cb1←'cb1'Add _.ejCheckBox 0 'Box 1'
Add _.br
⍝ We create an unchecked Syncfusion check box with caption 'Check Me!'
cb2←'cb2'Add _.ejCheckBox 0 'Box 1 is triState'
⍝ We tell the server to call program 'myCallback' any changes and to return
⍝ the value of the checkState variable in the model under the name 'state'
(cb2 cb1).On⊂'change' 'myCallback'(('state1' 'model' 'checkState' cb1)('state2' 'model' 'checkState' cb2))
⍝ A place to write the message
Add _.br
'output'Add _.div
∇
∇ r←myCallback;st1;st2;tri
:Access public
st1←Get'state1'
st2←Get'state2'
:If _what≡'cb1'
⍝ Display the state of the check box in the message area
r←'#output'Replace st1
:Else ⍝ must be cb2
⍝ Change the text of the check box
tri←st2≡'check'
r←'enableTriState'cb1.Update(tri+1)⊃_false _true
r,←'checkState'cb1.Update st1 ⍝i⊃'check' 'indeterminate'
r,←'#output'Replace'Box 1 is now ',(4×tri)↓'not triState'
:EndIf
∇
:EndClass