Revision history [back]

click to hide/show revision 1
initial version

answered 2018-10-19 13:01:09 +0800

cor3000 gravatar image cor3000

ZK Team

Before doBeforeComposeChildren ... there's nothing rendered yet so you can't select a listitem at this point.

onSelect$rsListBox is an event listener which also will only trigger if a component receives an event. If not yet rendered there won't be an event.

Said that, the thing you might have to look into is model-based rendering (either by template or item renderer). i.e. you populate the data and selected object(s) before the rendering happens.

here an example http://zkfiddle.org/sample/3ajgh1d/1-listbox-with-model-and-initial-selection

Before doBeforeComposeChildren ... there's nothing rendered yet so you can't select a listitem at this point.

onSelect$rsListBox is an event listener which also will only trigger if a component receives an event. If not yet rendered there won't be an event.

Said that, the thing think you might have to look into is model-based rendering (either by template or item renderer). i.e. you populate the data and selected object(s) before the rendering happens.

here an example http://zkfiddle.org/sample/3ajgh1d/1-listbox-with-model-and-initial-selection

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