Start a new topic

Setting variable or object on a different page

 I have a small project which now has 3 pages. If I push one of the four buttons on page2 then the text of an object on page0 should change.

The actual textbox has the ID "status" so I should be able to write text by using status.txt="text". That does work as long as I want to change the text from the same page the textbox is on.

Is there a way to change the .txt of an object by a button on a other page?

I have declared the variables as global but it doesn't seem to make a difference.

Any one can help?

(73.4 KB)

1 person likes this idea

Hi Bas,

I do not know. :-(

more may have something to information from the zip file.

here I see the solution for you question

greeting Vic

Hoi Bas,

ik weet het niet. :-(

maar mogelijk heb je wat aan de info uit het zip bestand.

hier in zie ik de oplossing voor jou vraag

groetjes Vic

(1.42 MB)

1 person likes this
Hoi Vic,

Wederom bedankt voor je input! Ik zal verder in het Engels zodat anderen er ook wat van begrijpen.

I had fount the particular project too but in my Nextion version it doesn't function. If I press the settings button nothing happens. And not much is configured on the touch press/release neither.
I found another example which uses something like: page0.status.txt="Uit (H)" That works fine so my question is answered.

Personally I don't really understand the idea about the global variables. Because the example above probably will work with local variables as well. If a variable is declared as global it makes more sense that I can call it on each page by just referring to the variable name without referring to the page the variable is at.

One tip for the developers of the Nextion system, make an overview of all available functions as soon as possible. I haven't found information on the wiki yet about the functions such as page0.(variable).txt/val.
The documentation of the Nextion is a bit thin in my opinion.


1 person likes this
Login or Signup to post a comment