Biglistbox Template"

From Documentation
m ((via JWB))
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
Similar to [[ZK Developer's Reference/MVC/View/Template/Listbox Template|Listbox]], you can render a biglistbox with a template. However, notice that, unlike other components, biglistbox doesn't allow any child component, so you have to render each item as a string. For example,
 
Similar to [[ZK Developer's Reference/MVC/View/Template/Listbox Template|Listbox]], you can render a biglistbox with a template. However, notice that, unlike other components, biglistbox doesn't allow any child component, so you have to render each item as a string. For example,
  
<source lang="xml" high="1,5,10">
+
<source lang="xml" highlight="1,5,10">
 
<biglistbox hflex="1" vflex="1" model="${data}" >
 
<biglistbox hflex="1" vflex="1" model="${data}" >
 
     <!-- Template example -->
 
     <!-- Template example -->
Line 20: Line 20:
 
As you can see, we utilize two attributes - ''rowIndex'' & ''colIndex'' from the ''matrixInfo'' object to receive the current index during template rendering phase.
 
As you can see, we utilize two attributes - ''rowIndex'' & ''colIndex'' from the ''matrixInfo'' object to receive the current index during template rendering phase.
  
where we assume there is a matrix model ([https://github.com/zkoss/zk/blob/master/zktest/src/org/zkoss/zktest/test2/big/FakerMatrixModel.java FakerMatrixModel]) called <tt>data</tt>  such as:
+
where we assume there is a matrix model ([https://github.com/zkoss/zk/blob/master/zktest/src/org/zkoss/zktest/test2/big/FakerMatrixModel.java FakerMatrixModel]) called <code>data</code>  such as:
  
 
<source lang="java">
 
<source lang="java">
Line 27: Line 27:
  
 
=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


Biglistbox Template


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

<biglistbox hflex="1" vflex="1" model="${data}" >
    <!-- Template example -->
    <template name="heads">
        <html><![CDATA[
                <div class="images_${matrixInfo[0]}" title="x=${matrixInfo[0]},y=${matrixInfo[1]}">${each[matrixInfo[0]]}</div>
        ]]></html>
    </template>
    <template name="rows">
        <html><![CDATA[
                <div class="images_${matrixInfo[0]}" title="x=${matrixInfo[0]},y=${matrixInfo[1]}">${each[matrixInfo[0]]}</div>
        ]]></html>
    </template>
</biglistbox>

As you can see, we utilize two attributes - rowIndex & colIndex from the matrixInfo object to receive the current index during template rendering phase.

where we assume there is a matrix model (FakerMatrixModel) called data such as:

FakerMatrixModel model = new FakerMatrixModel(100, 100);

Version History

Version Date Content
6.0.1 March 2012 The biglistbox component was introduced.



Last Update : 2022/07/08

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