0

MVVM property binding order

asked 2017-06-26 08:36:02 +0800

JustinFrost gravatar image JustinFrost
139 1 6

Hi All,

One of the biggest issues we are having with our ZK application is that we have no control on which the property bindings occur on a zul page.

We use a lot of custom build components and we need to rely on the order setters are called. For example we have a panelForm which accepts a disabled property which will loop through all of its child component and disable them.

We need to make sure all components are at an enable state when the form setVisible(true).

<panelform visible="@load(vm.dataModel.open)" disabled="@load(vm.dataModel.disabled)"/>

PanelForm

    setVisible(boolean visible){
        if (visible)
            enableFormComponents();
    }
    setDisabled(boolean disabled){
        if (disabled)
            disableFormComponents();
    }
}

We are finding sometimes the setDisabled is called before the setVisible when we notify on vm.dataModel. How is this order determined ?

Is there anyway to control this ?

Cheers.

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-06-26 08:36:02 +0800

Seen: 25 times

Last updated: Jun 26 '17

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