Revision history [back]

click to hide/show revision 1
initial version

asked 2022-07-13 21:21:01 +0800

KlausWr gravatar image KlausWr

Listbox: Modify Listitem children in @AfterCompose

I have an interesting question:

If I create a listbox in a zul in MVVM style like:

<listbox id="myListbox" model="@bind(vm.list)">
 <template name="model">
    <listitem>
        <listcell>
            <textbox value="@bind(each)"/>
        </listcell>
 </template>
</listbox>

And want to modify the Textbox component (e.g. by adding a dynamic constraint) in the java ViewModel:

@Wire Listbox myListbox; ... @AfterCompose public void afterCompose(@ContextParam(ContextType.VIEW) Component view) { Selectors.wireComponents(view, this, false); TextBox tb = myListbox.get???? tb.setConstraint("no empty");

So, how do I access the Textbox component????

Listbox: Modify Listitem children in @AfterCompose

I have an interesting question:

If I create a listbox in a zul in MVVM style like:

<listbox id="myListbox" model="@bind(vm.list)">
 <template name="model">
    <listitem>
        <listcell>
            <textbox value="@bind(each)"/>
        </listcell>
 </template>
</listbox>

And want to modify the Textbox component (e.g. by adding a dynamic constraint) in the java ViewModel:

@Wire Listbox myListbox; ... @AfterCompose ...

@AfterCompose

public void afterCompose(@ContextParam(ContextType.VIEW) Component view) { {

Selectors.wireComponents(view, this, false);
 TextBox tb = myListbox.get????
 tb.setConstraint("no empty");

empty");

So, how do I access the Textbox component????

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