zk6.x - lang-addon annotation - Array of attribute values not allowed

asked 2013-05-09 08:43:51 +0800

jayzk gravatar image jayzk
37 3

updated 2013-05-09 08:47:01 +0800


I am upgrading my project from zk5.x to zk6.x. I have extended the zk component and adding my converter to the lang-addon.xml. As per documentation, zk should override the previous one, rather, it seems to be creating an array and throws an error that array is not allowed. This was working fine in zk5.x

As per documentation:

converter. You can specify the class name of the converter that implements the TypeConverter interface. It is used to convert the value between component attribute and bean field. Multiple definition is NOT allowed and the later defined would override the previous defined one.

Here is my lang-addon.xml definition:


I get the following error: org.zkoss.zk.ui.UiException: Array of attribute values not allowed, [org.zkoss.zkplus.databind.SelectedComboitemConverter, com.mycompany.MyComboboxConverter]

As you can see, I am adding only my converter MyComboboxConverter, the other converter seems to be added by zk.

Please help.

Regards, Jay

delete flag offensive retag edit


This new code check in DataBinder.java is causing the issue.

In zk 6.5.1 String tag = entry.getKey(); String[] tagval = entry.getValue(); String tagExpr; if (tagval.length != 1) throw new UiException("Array of attribute values not allowed, "+Objects.toStr

jayzk ( 2013-05-10 11:47:51 +0800 )edit

Could you provide a sample that can reproduce this issue?

benbai ( 2013-06-20 05:32:52 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-20 05:52:34 +0800

benbai gravatar image benbai
2228 6


The sample below works well for me in ZK 6.5.1


    <window apply="org.zkoss.bind.BindComposer"
        viewModel="@id('vm') @init('test.TestVM')">
        <combobox model="@load(vm.model)"
            selectedItem="@bind(vm.selectedItem)" />
        <combobox model="@load(vm.model)"
            selectedItem="@bind(vm.selectedItem)" />


package test;

import java.util.ArrayList;
import java.util.List;

import org.zkoss.zul.ListModelList;

 * tested with ZK 6.5.1
 * @author benbai
@SuppressWarnings({ "rawtypes", "unchecked" })
public class TestVM {
    private ListModelList _model;
    private String _selectedItem;
    public ListModelList getModel () {
        if (_model == null) {
            List l = new ArrayList();
            l.add("item 1");
            l.add("item 2");
            l.add("item 3");
            _model = new ListModelList(l);
        return _model;
    public void setSelectedItem (String selectedItem) {
        _selectedItem = selectedItem;
    public String getSelectedItem () {
        return _selectedItem;


package test;

import org.zkoss.bind.BindContext;
import org.zkoss.bind.converter.sys.ComboboxSelectedItemConverter;
import org.zkoss.zk.ui.Component;

public class TestComboboxSelectedItemConverter extends ComboboxSelectedItemConverter {

    private static final long serialVersionUID = -2681108761775546276L;
    public Object coerceToUi(Object val, Component comp, BindContext ctx) {
        return super.coerceToUi(val, comp, ctx);
    public Object coerceToBean(Object val, Component comp, BindContext ctx) {
        return super.coerceToBean(val, comp, ctx);







link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2013-05-09 08:43:51 +0800

Seen: 28 times

Last updated: Jun 20 '13

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