0

Custom Component MVVM, custom properties

asked 2017-03-07 01:09:12 +0800

psinalberth gravatar image psinalberth
52 6

updated 2017-03-09 23:48:05 +0800

Hi, I've created a custom component in ZK8. I'm using data binding just like the MVVM book, but I got this problem: my component has a property like 'customProperty' som my zul is <customcomponent customProperty="value"/>, which is always null in CustomComponent.java. I need customProperty to set some behaviors for my component, but it's not working. Any ideas?

[Update]

Sorry, I've been so busy these days.. Well, this is my code

<lookupbox readonly="true" sclass="form-input" columns="name, address" value="@bind(detail.person)"/>

And the java class:

public class Lookupbox extends Bandbox {

private static final long serialVersionUID = 5780997619297491961L;

private Listbox listbox;    
private String columns;

@NotifyChange({"listbox", "columns"})
private void init() {

    listbox = new Listbox();

    Listhead listhead = new Listhead();

    if (columns != null) {

        String [] column = columns.split(",");

        for (String col : column) {
            listhead.appendChild(new Listheader(col));
        }
    }

    listbox.appendChild(listhead);

    Bandpopup bandpopup = new Bandpopup();
    bandpopup.appendChild(listbox);

    this.appendChild(bandpopup);
}

public Lookupbox() {

    init();
}

public String getZclass() {
    return _zclass == null ? "z-lookupbox" : _zclass;
}

public Listbox getListbox() {
    return listbox;
}

public String getColumns() {
    return columns;
}

@NotifyChange("columns")
public void setColumns(String columns) {
    this.columns = columns;
}

}

columnsproperty is always null. Am I missing some @NotifyChange()?

delete flag offensive retag edit

Comments

Show component code and zul part please

chillworld ( 2017-03-07 05:05:27 +0800 )edit
Be the first one to answer this question!
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

Follow
1 follower

RSS

Stats

Asked: 2017-03-07 01:09:12 +0800

Seen: 47 times

Last updated: Mar 09 '17

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