Revision history [back]

click to hide/show revision 1
initial version

answered 2021-03-24 12:27:49 +0800

cor3000 gravatar image cor3000

ZK Team

no need to think, you simply found a bug, which has been there forever (12 years):

https://github.com/zkoss/zk/blame/0efb2dbfa21ebf2cbec4b601375d1e1037000ed0/zk/src/archive/web/js/zk/dom.ts

--> ZK-4831

no need to think, you simply found a bug, bug in the parseStyle() function which has been there forever (12 years):

https://github.com/zkoss/zk/blame/0efb2dbfa21ebf2cbec4b601375d1e1037000ed0/zk/src/archive/web/js/zk/dom.tsyears)

--> ZK-4831

no need to think, think deeply, you simply found a bug in the parseStyle() function which has been there forever (12 years)

--> ZK-4831

If you're losing your jquery listeners I assume you only initialize them at page load time. Ideally you initialize your custom JS code whenever ZK (re-)renders a dom element. E.g. in a w:onBind listener. Doing so your init code is called again e.g. after an invalidate or in case of components being added on demand later.

<zk xmlns:w="client">
  ...
  <div w:onBind="myinit(this)">
  ...

Now a function {{myinit(wgt)}} will be called everytime the div is being rendered initially and after updates (invalidates/parent-changes).

You can use the wgt (widget object) directly in jquery jq(wgt).on(... or get the corresponding DOM node if needed : wgt.$n().

no need to think deeply, you simply found a bug in the parseStyle() function which has been there forever (12 years)

--> ZK-4831

If you're losing your jquery listeners I assume you only initialize them at page load time. Ideally you initialize your custom JS code whenever ZK (re-)renders a dom element. E.g. in a w:onBind listener. Doing so your init code is called again e.g. after an invalidate or in case of components being added on demand later.

<zk xmlns:w="client">
  ...
  <div w:onBind="myinit(this)">
  ...

Now a function {{myinit(wgt)}} myinit(wgt) will be called everytime the div div is being rendered initially and after updates (invalidates/parent-changes).

You can use the wgt (widget object) directly in jquery jq(wgt).on(... or get the corresponding DOM node if needed : wgt.$n().

no need to think deeply, you simply found a bug in the parseStyle() function which has been there forever (12 years)

--> ZK-4831

If you're losing your jquery listeners I assume you only initialize them at page load time. Ideally you initialize your custom JS code whenever ZK (re-)renders a dom element. E.g. in a w:onBind listener. Doing so your init code is called again e.g. after an invalidate or in case of components being added on demand later.

<zk xmlns:w="client">
  ...
  <div w:onBind="myinit(this)">
  ...

Now a function myinit(wgt) will be called everytime the div is being rendered initially and after updates (invalidates/parent-changes).

You can use the wgt (widget object) directly in jquery jq(wgt).on(... or get the corresponding DOM node if needed : wgt.$n().

UPDATE 2021-04-26: ZK-4831 will be fixed in 9.6.0 - a testable version is already available in 9.6.0.FL.20210423(-Eval)

no need to think deeply, you simply found a bug in the parseStyle() function which has been there forever (12 years)

--> ZK-4831

If you're losing your jquery listeners I assume you only initialize them at page load time. Ideally you initialize your custom JS code whenever ZK (re-)renders a dom element. E.g. in a w:onBind listener. Doing so your init code is called again e.g. after an invalidate or in case of components being added on demand later.

<zk xmlns:w="client">
  ...
  <div w:onBind="myinit(this)">
  ...

Now a function myinit(wgt) will be called everytime the div is being rendered initially and after updates (invalidates/parent-changes).

You can use the wgt (widget object) directly in jquery jq(wgt).on(... or get the corresponding DOM node if needed : wgt.$n().

UPDATE 2021-04-26:

ZK-4831 will be fixed in 9.6.0 - a testable version is already available in 9.6.0.FL.20210423(-Eval)

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