Message: "Failed to process setattr zkoss - ZK."

asked 2019-10-14 23:07:17 +0800

RicardoRivas gravatar image RicardoRivas

Hi, I have a problem. When the window is loading we see the following message: "Failed to process setattr zkoss - ZK."

Show the message for a moment and then finish loading the window.

Would there be any way that this message does not come out?

Browser: IE 11 ZK version: 8.0.4

delete flag offensive retag edit

8 Answers

Sort by » oldest newest most voted

answered 2019-10-15 17:52:01 +0800

MDuchemin gravatar image MDuchemin
1743 1 5
ZK Team

Hi RicardoRivas, welcome to the forum.

This message indicates that a JavaScript function went wrong and tried to access an undefined value, or a value on an undefined attribute.

When this happen, there should be a trace in your JS console (in browser's developer tools) which should give more info on what went wrong. Please paste it here with the whole stack trace below it so that we can have a more in-depth look :)

if you can also give a short description of what kind of action trigger the issue, would also be helpful.

link publish delete flag offensive edit

answered 2019-10-24 14:36:24 +0800

RicardoRivas gravatar image RicardoRivas

Hi MDuchemin, thank you for you answer.

The following trace is shown on my JS console.

SCRIPT5007: Unable to get value of the property 'innerHTML': object is null or undefined zk.wpd (23,7705)

This trace is only displayed when it is running in IE. This problem happens when I press a button to change pages. At the moment the page is loading, this message is displayed for a moment and then the page loads normally.

link publish delete flag offensive edit


Hi, it looks like a JS script tried to access the innerHTML value of a non-existing dom node.

MDuchemin ( 2019-10-24 18:40:36 +0800 )edit

In the JS console, there should be a way to show the full stack trace including the previous function calls leading to the error.

MDuchemin ( 2019-10-24 18:41:13 +0800 )edit

This should give an idea of which workflow caused the issue. can you paste it here?

MDuchemin ( 2019-10-24 18:41:38 +0800 )edit

answered 2019-11-12 00:53:55 +0800

RicardoRivas gravatar image RicardoRivas

Hi MDuchemin, here i paste the stack trace.

The object return for the function s.$n() is:

th class="z-column z-column-sort" id="sXAPl" style="text-align: left;">

When parentNode is done on this object it fails

STACKTRACE: [Subproceso principal]

zFlex.fixFlex [Line: 24, Col: 3974], zk.wpd zFlex.onSize [Line: 24, Col: 3522], zk.wpd n [Line: 13, Col: 1123], zk.wpd fire [Line: 13, Col: 854], zk.wpd o [Line: 13, Col: 2700], zk.wpd fire [Line: 13, Col: 3549], zk.wpd fire [Line: 16, Col: 6227], zk.wpd h [Line: 21, Col: 6908], zk.wpd

[Llamada asincrónica] d [Line: 21, Col: 9761], zk.wpd bH.event.dispatch [Line: 9, Col: 54118], zk.wpd cb.handle [Line: 9, Col: 50286], zk.wpd

[Llamada asincrónica] bH.event.add [Line: 9, Col: 50915], zk.wpd Anonymous function [Line: 9, Col: 60913], zk.wpd each [Line: 9, Col: 5930], zk.wpd bH.prototype.each [Line: 9, Col: 2184], zk.wpd on [Line: 9, Col: 60885], zk.wpd bH.fn[e] [Line: 9, Col: 83632], zk.wpd Anonymous function [Line: 21, Col: 10098], zk.wpd b2 [Line: 9, Col: 31197], zk.wpd ca.fireWith [Line: 9, Col: 32201], zk.wpd ready [Line: 9, Col: 3623], zk.wpd

[Llamada asincrónica] bH.ready.promise [Línea: 9, Col: 8092], zk.wpd bH.prototype.ready [Línea: 9, Col: 2229], zk.wpd bH.prototype.init [Línea: 9, Col: 1789], zk.wpd bH [Línea: 9, Col: 222], zk.wpd Anonymous function [Línea: 9, Col: 36106], zk.wpd Anonymous function [Línea: 9, Col: 33957], zk.wpd Global code [Línea: 9, Col: 2], zk.wpd

link publish delete flag offensive edit

answered 2019-11-12 17:35:27 +0800

MDuchemin gravatar image MDuchemin
1743 1 5
ZK Team

Hi Ricardo, From your description, it looks like the column is no longer attached to the page, but is still trying to resize itself. Stacktrace is somewhat difficult to parse, since it's using minified code.

I'd recommend activating debug-js mode (display non-minified JS in browser) with : <client-config> <debug-js>true</debug-js> </client-config> in zk.xml

Also, could you give me a small overwiew of where this column is located? If you can make a fiddle to reproduce, that'be helpful :) (bumped your karma to enable links in your posts)

link publish delete flag offensive edit

answered 2019-11-13 23:19:40 +0800

RicardoRivas gravatar image RicardoRivas

Hi MDuchemin, I have activated debug mode. I attached the stack trace. It seems that the method that generates this problem is _docResize. Do you know when this method is called?

zFlex.fixFlex [Línea: 21602, Col: 4], zk.wpd

zFlex.onSize [Línea: 21570, Col: 3], zk.wpd

_invoke [Línea: 12829, Col: 5], zk.wpd

fire [Línea: 12812, Col: 7], zk.wpd

_fire [Línea: 12955, Col: 5], zk.wpd

fire [Línea: 13046, Col: 3], zk.wpd

fire [Línea: 14348, Col: 5], zk.wpd

_docResize [Línea: 19618, Col: 4], zk.wpd

link publish delete flag offensive edit

answered 2019-11-14 11:33:35 +0800

MDuchemin gravatar image MDuchemin
1743 1 5
ZK Team

Hi Ricardo,

Thanks for updating the debug stacktrace. Unless it's triggered manually, docResize should be caused by the browser window resizing, or by the device changing orientation (portrait <> landscape) if it's a mobile or tablet.

docResize might also happen if the ZK app is running inside of an IFrame which is resized.

If you put a breakpoint inside of either zFlex.fixFlex or _docResize, you can check from where this was called. If you find it's called by _sizeHandler (above in the async stack), then it's likely triggered by the actual browser window. If that's the case, it would be interesting to check if the issue is browser-related (only on Chrome, IE, Firefox, etc)

If the resize event comes from another source, then it's a good lead.

In any case, from the stacktrace, it looks like a speed condition between a resize event and a component being removed from the page. You can prevent the issue altogether by checking if the component is attached before firing fixFlex.

    zk.afterLoad("zk", function () {
        var _xzFlex = {};
        zk.override(zFlex, _xzFlex, {
            fixFlex: function(wgt) {
                if(wgt == null || wgt.$n() == null || wgt.$n().parentNode == null){
                    console.warn("skipped resize for widget: " + wgt);
                    return; //prevent default action
                var result = _xzFlex.fixFlex.apply(this, arguments);
                return result;

This should prevent the symptoms, since it will skip fixFlex for widgets that aren't attached to the page. Would still like to know the cause :)

regarding this script: you can deploy it in a single page with <script> tag, but it's be more efficient to deploy in lang-addon.xml if you need to have it active in every page of your application.

link publish delete flag offensive edit

answered 2019-11-20 00:29:10 +0800

RicardoRivas gravatar image RicardoRivas

Hi MDuchemin, I have added a script tag to the window. Now the same trace appears but the stackTrace indicates that the source of the problem is somewhere else.


[Subproceso principal]
zAu._doCmds [Línea: 20635, Col: 11], zk.wpd
afterResponse [Línea: 20235, Col: 3], zk.wpd
onResponseReady [Línea: 20232, Col: 3], zk.wpd

Exception stack trace:

"TypeError: No se puede obtener la propiedad 'innerHTML' de referencia nula o sin definir  
at Anonymous function (https://url/zkau/web/a8976732/js/zk.wpd:12028:4)   
at _calcMinWd (https://url/zkau/web/_zv2017011012/js/zul.mesh.wpd:114:6)   
at _calcMinWds (https://url/zkau/web/_zv2017011012/js/zul.mesh.wpd:1217:4)
at updateMesh_ (https://url/zkau/web/_zv2017011012/js/zul.mesh.wpd:2080:5) 
at setVisible (https://url/zkau/web/_zv2017011012/js/zul.mesh.wpd:2143:4) 
at zk.Object.prototype.$supers (https://url/zkau/web/a8976732/js/zk.wpd:10802:4)   
at setVisible (https://url/zkau/web/_zv2017011012/js/zul.grid.wpd:126:4)  
at _set2 (https://url/zkau/web/a8976732/js/zk.wpd:10333:5)
at setter.func (https://url/zkau/web/a8976732/js/zk.wpd:15880:7)
at Anonymous function (https://url/zkau/web/a8976732/js/zk.wpd:15908:4)"

Do you think they are related or are stand-alone errors?

Thank you for your help.

link publish delete flag offensive edit

answered 2019-11-20 16:09:28 +0800

MDuchemin gravatar image MDuchemin
1743 1 5
ZK Team

Good news: not the same error, not the same stack. That suggest the first error is prevented by the snippet posted last time.

Bad new: new error. It is triggered by setVisible (most likely on grid.setVisible, or column.setVisible), and it fails to find the DOM node associated with one of the widgets or its parent. Since we saw in your last stacktrace that the column's parent either is null or not attached, it's likely that this error is caused by the same condition.

I still can't tell if the widget is detached but not cleaned-up, or if it's in an unexpected state (attached, but with a DOM node removed or something like that).

Is it possible to make a zkfiddle sample of the issue? I'd be helpful to run the page locally to have a look at the exact sequence of events causing the issue.

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




Asked: 2019-10-14 23:07:17 +0800

Seen: 49 times

Last updated: Nov 20 '19

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