-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a custom form component which extends Div, in the setVisible method of this component there is some code to focus to the first element as follows:
setVisible(boolean visible){
if (visible){
for (Component c: getFormComponents()){
if (!c.getDisabled() && c.isVisible()){
c.setFocus();
break;
}
}
}
}
The zul page using this custom component is as follows:
<formComponent visible="@load(vm.formModel.open)">
<textbox visible="@load(vm.formModel.textType)" disabled="@load(vm.formModel.textDisabled)"/>
<textbox visible="@load(vm.formModel.value)"/>
</formComponent>
The issue I am having is that when the setVisible method is called as a result of notify on formModel.open the text box components have not yet been set visible/disabled because the @load binding has not yet been executed.
What order are the @load bindings executed, is there is any way to make the setVisible be executed last so it gets the correct visible and disabled values for the textboxes.
Thanks.
Ciao Justin. I recommend you to use template. The first template will use a label in place of the disabled textbox. The template selection depends on open, and the component textbox got a focus="true" as attribute.
Asked: 2017-05-04 03:44:53 +0800
Seen: 29 times
Last updated: May 08 '17
Problem binding values to a composite component
How to access static member field of a class in zul without zscript
How can i load a constant in .zul
MVVM Validator: class not found ? [closed]
MVVM tab box - delay @load until tab pane displayed?
mvvm, load or save with after or before for seach command
how to fire an event when a variable value loaded through VM
is there any event trigger from zk component on binding ?
ZK team plans to dispose of Composer EventQueues no longer in scope? [closed]