Radio and Radio Group"

From Documentation
m (Created page with '{{ZKDevelopersGuidePageHeader}} A radio button is a component that can be turned on and off. Radio buttons are grouped together using <tt>radiogroup</tt>. Only one radio button …')
 
m (correct highlight (via JWB))
 
Line 1: Line 1:
 
{{ZKDevelopersGuidePageHeader}}
 
{{ZKDevelopersGuidePageHeader}}
  
A radio button is a component that can be turned on and off. Radio buttons are grouped together using <tt>radiogroup</tt>. Only one radio button in a group may be selected at a time.
+
A radio button is a component that can be turned on and off. Radio buttons are grouped together using <code>radiogroup</code>. Only one radio button in a group may be selected at a time.
  
 
<source lang="xml" >
 
<source lang="xml" >
Line 14: Line 14:
  
 
=== Versatile Layouts ===
 
=== Versatile Layouts ===
You can add additional controls into <tt>radiogroups</tt> to achieve the desired layout, as illustrated below.
+
You can add additional controls into <code>radiogroups</code> to achieve the desired layout, as illustrated below.
  
 
[[Image:FormAndInput_5.png]]   
 
[[Image:FormAndInput_5.png]]   
Line 32: Line 32:
 
</source>
 
</source>
  
The radio button belongs to the nearest <tt>radiogroup</tt> ancestor. You can even nest one radio group within another and each of them will operate independently. However, there might be some sort of visual overlap.
+
The radio button belongs to the nearest <code>radiogroup</code> ancestor. You can even nest one radio group within another and each of them will operate independently. However, there might be some sort of visual overlap.
  
 
[[Image:FormAndInput_6.png]]   
 
[[Image:FormAndInput_6.png]]   

Latest revision as of 10:42, 19 January 2022

Radio and Radio Group


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


A radio button is a component that can be turned on and off. Radio buttons are grouped together using radiogroup. Only one radio button in a group may be selected at a time.

<zk>
	<radiogroup onCheck="alert(self.selectedItem.label)">
	    <radio label="Apple"/>
	    <radio label="Orange"/>
	    <radio label="Banana"/>
	</radiogroup>
</zk>

Versatile Layouts

You can add additional controls into radiogroups to achieve the desired layout, as illustrated below.

FormAndInput 5.png

<zk>
	<radiogroup>
	    <grid>
		    <rows>
		        <row><radio label="Apple" selected="true"/> Fruit, music or computer</row>
		        <row><radio label="Orange"/><textbox/></row>
		        <row><radio label="Banana"/><datebox/></row>
			</rows>
	    </grid>
	</radiogroup>
</zk>

The radio button belongs to the nearest radiogroup ancestor. You can even nest one radio group within another and each of them will operate independently. However, there might be some sort of visual overlap.

FormAndInput 6.png

<zk>
	<radiogroup>
	    <grid>
		    <rows>
		        <row>
					<radio label="Apple" selected="true"/> 
					Fruit, music or computer
				</row>
		        <row>
		        	<radio label="Orange"/>
		            
		            <radiogroup>
			            <radio label="Small"/>
			            <radio label="Large" selected="true"/>
		            </radiogroup>
		        </row>
		        <row>
		        	<radio label="Banana"/><datebox/>
		        </row>
			</rows>
	    </grid>
	</radiogroup>
</zk>



Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.