0

coerceFromString_ override no longer works from 6.5.1 [closed]

asked 2013-01-22 10:14:47 +0800

cvarona gravatar image cvarona
554 1 6

updated 2013-01-22 10:25:23 +0800

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

Hi,

there seems to be some problem with widget functions overriding starting from zk 6.5.1. This used to work in zk 6.5.0:

zk.$import('zul.inp.Doublebox', function(cls) {
        zul.inp.Doublebox.prototype.coerceFromString_ = function(value) {
                blabla
                ...
            }
} );

However, after upgrading to 6.5.1 and 6.5.1.1 it doesn't (my custom coerceFromString_ function does not get invoked any longer).

Has anybody experienced this problem? Should I open a bug report?

With kind regards

César Varona

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by cvarona
close date 2013-01-24 15:38:58

1 Answer

Sort by » oldest newest most voted
1

answered 2013-01-22 10:23:33 +0800

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

You may use zk.override() to do so.

For example,

<zk>
    <script>
    zk.$import('zul.inp.Doublebox', function(cls) {
    var oldDoublebox = {};
    zk.override(zul.inp.Doublebox.prototype, oldDoublebox, {
        coerceFromString_:function(value) {
                    alert(value);
                }
        });
    } );
    </script>
    <window title="My First Window" border="normal" width="200px">
    Hello, World!
        <doublebox/>
    </window>
</zk>
link publish delete flag offensive edit

Comments

Thanks a lot Chen, this works fine. Althoug, as a matter of fact, the old way still seems to be working in the online zksandbox. There must be some strange timing issue involved.

cvarona ( 2013-01-22 10:59:31 +0800 )edit

that's because we optimized some javascript so that it cannot override the JS object from the prototype directly.

jumperchen ( 2013-01-22 11:05:38 +0800 )edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-01-22 10:14:47 +0800

Seen: 16 times

Last updated: Jan 22 '13

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