The checkbox
tag provides a simple toggle
button that represents a value of true
or
false
. It has a disabled state where it does not
respond to mouse events when enabled=false
.
Example 42. simple checkbox
<canvas debug="true" height="160"> <debug x="135" y="15"/> <checkbox id="checkMe" text="Show Green Square"/> <view visible="${checkMe.value}" bgcolor="green" width="20" height="20"/> <button text="Toggle" onclick="checkMe.setAttribute('value', !checkMe.value)"/> <button text="Disable" onclick="checkMe.setAttribute('enabled', false)"/> <button text="Enable" onclick="checkMe.setAttribute('enabled', true)"/> <button text="status" onclick="Debug.write('value: '+checkMe.value)"/> <simplelayout axis="y" spacing="4"/> </canvas>
Note that checkbox attributes may be used as constraints for other attributes. In the example above, clicking the checkbox toggles the visibility of the green square. Whenever the value of the checkbox changes, so does the visibility attribute of the green view.
A checkbox component representing a booleanCopyright © 2002-2007 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.