Revision history [back]

click to hide/show revision 1
initial version

answered 2021-01-26 04:35:36 +0800

RomanZK gravatar image RomanZK

I am just realising I made a mistake. The field in question (i.e. accountCategory) is a multi valued field. It returns List<short>.

So I adjusted your code snippet as follows:

<listbox model="@init(countryCodes)" mold="select" width="100px" <br=""> selectedItems="@bind(each.attributes.accountCategory.values)" multiple="true"> <template name="model" var="countryCode"> <listitem label="@init(countryCode) @converter(countryDisplayConverter)"/> </template> </listbox>

The code works.

However, I also want to add that the previous code I shared now works as well.

<listbox mold="select" width="100px" selecteditems="@bind(each.attributes.accountCategory.values)" multiple="true"> <listitem label="${each.description}" foreach="${accountCategory}" value="${each.code}"/> </listbox>

This code uses the generic lov class.

Good to know that zk offers different options to achieve the same functionality.

Thanks.

I am just realising I made a mistake. The field in question (i.e. accountCategory) is a multi valued field. It returns List<short>.

So I adjusted your code snippet as follows:

 <listbox model="@init(countryCodes)" mold="select" width="100px" <br="">
        selectedItems="@bind(each.attributes.accountCategory.values)" multiple="true">
    <template name="model" var="countryCode">
        <listitem label="@init(countryCode) @converter(countryDisplayConverter)"/>
@converter(countryDisplayConverter)" />
    </template>
 </listbox>

</listbox>

The code works.

However, I also want to add that the previous code I shared now works as well.

<?variable-resolver class="com.LovResolver"?>

<listbox  mold="select" width="100px" selecteditems="@bind(each.attributes.accountCategory.values)" width="100px"
                                 selectedItems="@bind(each.attributes.accountCategory.values)" multiple="true">
                                    <listitem label="${each.description}" foreach="${accountCategory}" forEach="${accountCategory}" value="${each.code}"/>
                                </listbox>  

</listbox>

This code uses the generic lov class.

Good to know that zk offers different options to achieve the same functionality.

Thanks.

I am just realising I made a mistake. The field in question (i.e. accountCategory) is a multi valued field. It returns List<short>.

So I adjusted your code snippet as follows:

 <listbox model="@init(countryCodes)" mold="select" width="100px"                                     
       selectedItems="@bind(each.attributes.accountCategory.values)"  multiple="true">
    <template name="model" var="countryCode">
        <listitem label="@init(countryCode)  @converter(countryDisplayConverter)" />
    </template>
 </listbox>

The code works.

However, I also want to add that the previous code I shared now works as well.

<?variable-resolver class="com.LovResolver"?>
 <listbox  mold="select" width="100px"
          selectedItems="@bind(each.attributes.accountCategory.values)"  multiple="true">
     <listitem label="${each.description}" forEach="${accountCategory}"  value="${each.code}"/>
 </listbox>

This code uses the generic lov class.

Good to know that zk offers different options to achieve the same functionality.

Thanks.

I am just realising I made a mistake. The field in question (i.e. accountCategory) is a multi valued field. It returns List<short>.

So I adjusted your code snippet as follows:

 <listbox model="@init(countryCodes)" mold="select" width="100px"                                     
width="100px"
          selectedItems="@bind(each.attributes.accountCategory.values)" 
        multiple="true">
    <template name="model" var="countryCode">
        <listitem label="@init(countryCode) 
                         @converter(countryDisplayConverter)" />
    </template>
 </listbox>

The code works.

However, I also want to add that the previous code I shared now works as well.

<?variable-resolver class="com.LovResolver"?>
<listbox mold="select" width="100px"
         selectedItems="@bind(each.attributes.accountCategory.values)" 
         multiple="true">
    <listitem label="${each.description}" forEach="${accountCategory}" 
              value="${each.code}"/>
</listbox>

This code uses the generic lov class.

Good to know that zk offers different options to achieve the same functionality.

Thanks.

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More