Custom Mold error after upgrade to 9.6.4

asked 2023-07-07 22:05:33 +0800

faberdev gravatar image faberdev

Hello, I use zk 8.6 with this custom mold for checkbox:

<checkbox checked="@bind(value)" onCheck="@command(updateCommand)" label="@load(label)" mold="formgroup"/>
function (out) {
        var uuid = this.uuid, content = this.domContent_();
        out.push('<label', this.domAttrs_(), ' for="', uuid,'-real">',
                 '<input type="checkbox" id="', uuid, '-real"', this.contentAttrs_(), '/>',

After upgrade to 9.6.4 I get an error an global error : "error code 3 zk error after mounting" In the javascript console I see :

za11y.wpd:4 Uncaught TypeError: Cannot read properties of null (reading 'getAttribute')
    at r.bind_ (za11y.wpd:4:677)
    at r.bindChildren_ (zk.wpd:21:27149)
    at r.bind_ (zk.wpd:21:26711)
    at r.bindChildren_ (zk.wpd:21:27149)
    at r.bind_ (zk.wpd:21:26711)
    at r.bindChildren_ (zk.wpd:21:27149)
    at r.bind_ (zk.wpd:21:26711)
    at r.bindChildren_ (zk.wpd:21:27149)
    at r.bind_ (zk.wpd:21:26711)
    at r.bindChildren_ (zk.wpd:21:27149)

Can anyone help me ?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2023-07-11 18:37:39 +0800

MDuchemin gravatar image MDuchemin
2390 1 6
ZK Team

Hey there,

With the za11y library enabled (which adds wcag / aria attributes to the page), the checkbox will try the following logic to find the main node for za11y purposes:

getA11yRealNode_: function () {
            return this.$n((this._isDefaultMold() || this._isTristateMold()) ? 'real' : 'mold');

That means that in default mold or in tristate mold, it will attempt to find the node with uuid-real ID inside of the checkbox Otherwise, it will attempt to locate the node with "uuid-mold" id.

based on your mold, it appear that you have a mold entry, so it will attempt to locate the "uuid-mold" node.

However, your mold doesn't have such node (it has a -real node).

You can try renaming the -real to -mold (and relevant links in the label)

'<input type="checkbox" id="', uuid, '-mold"', this.contentAttrs_(), '/>'

Try if that works.

If it doesn't, you may need to override the getA11yRealNode_ on the checkbox to point to your actual node.

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

1 follower



Asked: 2023-07-07 22:05:33 +0800

Seen: 6 times

Last updated: Jul 11

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