Revision history [back]

click to hide/show revision 1
initial version

answered 2013-08-14 20:41:25 +0800

phdsong gravatar image phdsong

I was a little bit confused about the question. Now, I realize that this is binding/annotation question.

From ZK Example

ViewModel is as follows:

public class ShirtViewModel {

public List<String> getColors() {
    return ShirtData.getColors();
}

ZUL code

               <combobox id="cmbColor" width="150px"
                model="@load(vm.colors)" selectedItem="@bind(vm.shirtColor)">
                <template name="model">
                    <comboitem label="@load(each)"
                        image="@load(vm.getIconImage(each))" />
                </template>
            </combobox>

I believe the zul code, @load with List<String>, manages convert List<String> to ListModel<String>. I think Binder kicks in to call some methods to convert them. Anyone knows what part of code does the job?

I was a little bit confused about the question. Now, I realize that this is binding/annotation question.

From ZK Example

ViewModel is as follows:

public class ShirtViewModel {

public List<String> getColors() {
    return ShirtData.getColors();
}

ZUL code

               <combobox id="cmbColor" width="150px"
                model="@load(vm.colors)" selectedItem="@bind(vm.shirtColor)">
                <template name="model">
                    <comboitem label="@load(each)"
                        image="@load(vm.getIconImage(each))" />
                </template>
            </combobox>

I believe the zul code, @load with List<String>@load(vm.colors) whose colors from List<String> getColors(), manages convert List<String> to ListModel<String>. I think Binder kicks in to call some methods to convert them. Anyone knows what part of code does the job?

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