Thanks! I'll try later. ATM I'm using @Init and using viewModel
attribute instead that custom one, like chillworld said. ViewModel was always null because I forgot @Init on my VM class. My bad =(. Thanks!
-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi. I'm trying to create a macro component like a wizard
. Just like a tutorial from ZK page, my Wizard
extends HtmlMacroComponent
. In zul, I'm doing something like
<wizard foo="bar" wizardModel="@init(vm.wizard)"/>
I can get foo
value by using ${arg.foo}
on wizard.zul
but wizardModel
is always null. I intend to use it to be wizard's viewmodel.
That's how I've coded wizard.zul
:
<zk>
<div viewModel="@id('wizard') @init(wizardModel)">
...
</div>
</zk>
@init
executes after the component was created. The wizard example was designed to demonstrate how shadow elements improve certain limitations in older approaches in ZK such as macro or the <include> component.
If you were planning to use @init() then a static EL should work as it evaluates before the component is created.
<wizard foo="bar" wizardModel="${vm.wizard}"/>
Thanks! I'll try later. ATM I'm using @Init and using viewModel
attribute instead that custom one, like chillworld said. ViewModel was always null because I forgot @Init on my VM class. My bad =(. Thanks!
Asked: 2018-05-03 06:50:49 +0800
Seen: 10 times
Last updated: May 08 '18
search button using validation
my login/index zul page is loading twice, where as i am only calling it once
Databinding and auto-complete on combobox
Multiple selection using ListModelMap<Key, Obj>
Notify Form of property change
How to handle lists and complex types with form?
multiple checkboxes in a row of listbox
did you try just changing the wizardModel to the real declaration of the viewmodel there?
chillworld ( 2018-05-04 15:03:29 +0800 )editHi! I was trying to use
psinalberth ( 2018-05-08 19:18:36 +0800 )editviewModel
and my custom attribute, but I forgot to put@Init
on VM. After fixing it, I could access all properties. Thanks!