Start a new topic

vis does not work properly

When I set vis ID,0 where ID is my component ID (a button) all the objects in the windows disappear.


I have no problems with vis to hide or show single IDs Components.


i.e.:

vis 12,0

hide ID 12

vis 12,1

shows the ID 12


works for hotspot and picture, did not test buttons

No it does not work. When I send the following command from the microcontroller to the display, ALL components are hidden, this is not correct.


 

vis sensor1_status, 0

 

Try to remove the space between "," and "0".

That is what I also tried, same result.

Upload your project here.

It works fine here even if i use the component name instead of the component ID

I tested with your name "sensor1_status" and it does work.


So there is something else wrong in your project.

I fixed it through a workaround. I first set vis 255,1 in order to make everything visible and then vis ID,0 I also called ref ID in order to refresh the item status.

I prefer to find the root cause instead of doing work-arounds :)


There must be something different at your project because it works at all others.


But if you can live with that, why not ;)

The point is, there's really nothing on the code side. At a timer event I do:


vis 12,0

OffTimer.en=0


And that's it

The code on the button is empty, so I don't see what could be wrong. The button is also the last placed item. I also tried with just 3 elements: an image on the background, a text field and the button. Same result.

The whole project was started with a previous version of the editor. After updating, the project has been moved to the new format. I don't know if that could be the reason.

I also use the same project since the beginning and it was updated to the new format all the time i updated nextion editor.


I tested in my (not small) project, added a timer event to hide a button after 2000ms

vis 14,0

tm0.en=0


it works. Open the page and after 2000ms the button is hidden. and only the button not everything :)


I think without having your project it makes no sense to help.


If you have no warnings at the console when you compile the project everything should work.

I've just created this test. Same problem. I didn't try on the real hardware, just on the editor

HMI
(195 KB)

Now i see the problem.


DONT do a background image as its own image

you dont need to create a fullscreen image.

just click on a free space at the "white" picture and choose in the attributes "sta = image"

then select your background picture


The reason why everything is hidden is simple. the fullscreen picture comes up to the top layer when vis will be used.

don't know exactly why but i want to have as less as possible components, so i work with background image of the page instead of creating picture component.


try it and you will see it works :)

Yep, it works :-)


Thanks for your help ;)


I can also confirm that this works! Thanks for looking into this Alex :)

This is quite a pitfall ;)

Alex, you are the MAN, tahnks !!!!

Login or Signup to post a comment