Searchbox Template"

From Documentation
(Searchbox template)
 
m ((via JWB))
 
(2 intermediate revisions by the same user not shown)
Line 25: Line 25:
 
</source>
 
</source>
  
where we assume there is a list model (<javadoc>org.zkoss.zul.ListModel</javadoc>) called <tt>users</tt>  such as:
+
where we assume there is a list model (<javadoc>org.zkoss.zul.ListModel</javadoc>) called <code>users</code>  such as:
  
 
<source lang="java">
 
<source lang="java">
Line 32: Line 32:
  
 
=Version History=
 
=Version History=
{{LastUpdated}}
+
 
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-

Latest revision as of 07:34, 8 July 2022


Searchbox Template


Similar to Listbox, you can render a searchbox with a template. However, notice that, unlike other components, searchbox doesn't allow any child component, so you have to render each item as a string, a <label> or a <html>. For example,

<searchbox model="${users}">
	<template name="model">
		Name is ${each}
	</template>
</searchbox>

<searchbox model="${users}">
	<template name="model">
		<label value="Name is ${each}"/>
	</template>
</searchbox>

<searchbox model="${users}">
	<template name="model">
		<html><![CDATA[
		Name is ${each}
		]]></html>
	</template>
</searchbox>

where we assume there is a list model (ListModel) called users such as:

ListModelList model = new ListModelList(new String[] { "Tony", "Ryan", "Jumper", "Wing", "Sam" });

Version History

Version Date Content
9.0.0 September 2019 ZK-4380: Provide a Searchbox component



Last Update : 2022/07/08

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