# DataBinder: Changing default save-when and save for all components

xmedeko
1031 1 16
http://xmedeko.blogspot.c...

Hi,

I have some pages, when all my components using databinding have save='false', and other pages, when all components have save-when=''. Is a tedious to write it again and again. Is it possible to change the default behaviour of the binder just for the current page and not for the whole application?

Thanks

delete retag edit

## 6 Replies

TOtte
93 2

yes you can use macro components
e.g.: <?component name="intbox" extends="intbox" save-when="none"?>
I haven't tested this, but it should work this way.

xmedeko
1031 1 16
http://xmedeko.blogspot.c...

Well, then I must have a macro for each input component, then it's better to write save-when='none'. I was looking for something like

binder.setDefaultXXX()

Maybe I can go through all component in the page and set this annotation, but would not work when some components are dynamically added.

937 2 12

I have the same needs, would be nice to define a default behavior for the whole app.

xmedeko
1031 1 16
http://xmedeko.blogspot.c...

For the whole app, you may redefine each component in lang-addon.xml.

henrichen
3869 2

@xmedeko,

Would you help post this to ZK Features, so we can track it. Thanks.

xmedeko
1031 1 16
http://xmedeko.blogspot.c...

Feature Request ID: 2967264

[hide preview]