Nextion Library's setText() function not working

I was working on interfacing a Nextion Display with Arduino Mega.

The GUI has 3 Pages. The first page is used to display data, while the other two are used to take inputs and set some parameters.

After the user inputs data into the text box, I tried to get the value of the text box with the getText() method which is a member function of the NexText calss.

The method works fine if the text box is on the first page, but fails if it is on the second or the third page.

Has anyone encountered the same problem and have a fix for this ?

in Nextion IDE, have you tried setting all the pages to 'global scope' instead of 'local' ?

No, I'll try that now and post the result.
Sorry for the late reply.

Still does not work after setting the page scope to global