Page 1 of 1

TypeError: Cannot read property 'document' of null onclick

Posted: Fri Aug 31, 2018 9:10 am
by vakhsakhalyan
I have updated Siesta to servion 5.0.0. and have a problem with click event.
After click on some element I get this error:
TypeError: Cannot read property 'document' of null. Here is a smaal part of code:
  loginBtn    = tExt.ComponentQuery.query('#login')[0]; t.chain(

                        function(next) {
                            t.click(loginBtn, callback);
                        }
)
.
What is wrong in this code?

Re: TypeError: Cannot read property 'document' of null oncli

Posted: Fri Aug 31, 2018 9:16 am
by nickolay
Hi,

This code is not syntactically correct. You can't place assignment inside the function call.

Sorry, correcting syntax errors is out of the scope of this forum. Please refer to the online JavaScript learning materials.

Re: TypeError: Cannot read property 'document' of null oncli

Posted: Fri Aug 31, 2018 9:37 am
by vakhsakhalyan
Yes, Sorry I have updated the code. But the error is become from siesta-all.js

Re: TypeError: Cannot read property 'document' of null oncli

Posted: Fri Aug 31, 2018 9:42 am
by nickolay
You don't need to make component query separately - Siesta supports it as target locator. See https://www.bryntum.com/docs/siesta/#!/ ... tionTarget for details.

So the code you posted (it has unknown variable "callback" btw) can be simplified just to:
t.chain(
    { click : '>>#login' }
)
Its not enough information to help you, please provide more details or a reproducible test case.