0

Form Binding - Default values in dependent fields - ZK8

asked 2016-01-05 09:23:07 +0800

eclipse1 gravatar image eclipse1
21 4

Hi!

In our project we need to set default values in dependent fields for different view models.

With ZK7 we implemented a mechanism described here:

http://forum.zkoss.org/question/98888/form-bind-default-values-in-dependent-fields/

With the new ZK 8 form approach that does not work, is there any way to do with ZK8?

Thank you all :)

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-01-07 10:24:34 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

updated 2016-01-07 10:26:29 +0800

I updated two classes TestObserver and TestObservableForm from the zkfiddle example

Here is what I did for ZK 8 with them:

  1. Change the implementation from the interface of FormImpl to Form and FormProxyObject, and then in your example, it requires a Map-like implementation used in the Zul file (like fx.value and fx.date), so I implement TestObservableForm to extend from MapProxy, which was created since ZK 8.0.0 release.
  2. Override the method of put() to intercept the value of the field when it has changed to trigger its notifyChanges() method (the same as setField() for ZK 7)
  3. Replace the usage of TestObserver with the put() method of Map instead.
link publish delete flag offensive edit
Your answer
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: 2016-01-05 09:23:07 +0800

Seen: 15 times

Last updated: Jan 07 '16

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