zkoss/zk — pull request #55 by mkrizmanic (2014-03-09 10:10:53+00:00)
Title: UI template may return null parameters

org.zkoss.zk.ui.util.Template implementation may return null parameters
to render each item inside listbox, grid, combobox, ... elements.

It enables users to not return parameters in their own Template implementations. For example:
```java
import org.zkoss.bind.Binder;
import org.zkoss.bind.sys.TemplateResolver;
import org.zkoss.zk.ui.util.Template;
// + other imports

class PersonListboxTemplate implements Template {
String NAME_ATTR = TemplateResolver.EACH_VAR + "." + Person.NAME_ATTR;

private Binder binder;

PersonListboxTemplate(Binder binder) {
this.binder = binder;
}

@Override
public Component[] create(Component parent, Component insertBefore, VariableResolver resolver, Composer composer) {
Listitem listitem = new Listitem();

// name
Listcell nameCell = new Listcell();
listitem.appendChild(nameCell);
binder.addPropertyLoadBindings(nameCell, "label", NAME_ATTR, null, null, null, null, null);

// append to the parent - omitted
// ..
}

@Override
public Map getParameters() {
return null;
}
}
```

In the other case, users have to return the empty map at least, what is unnecessary. For instance:
```java
class PersonListboxTemplate implements Template {
private Map params;

// ...

@Override
public Map getParameters() {
if (params == null) {
params = new HashMap<>();
}
return null;
}
}
```