Start a new topic
Implemented

Manually set component ID

 Component IDs changes "randomly" and I found myself every time re-assigning them in my main program after fetching new component ids, it would be very practical if these Ids could be set manually.

Thanks


6 people like this idea

We are looking for a way to solve this issue.

Thanks, it would really help

 

Perhaps changing the component ids wouldn't matter so much if there was a way to obtain the objname for a component with something like:

get 1.objname

or, when you set "Send Component ID", have it also set the objname.

 


4 people like this

Or maybe better the other way round - return the ID of a component known by name, as the name does not change. A possibly syntax - consistent with everything - would be


get objname.id


So just make id a "green member" ;-)



Just out of curiousity tried and realized, THIS ACTUALLY ALREADY WORKS !!!!!


Ahh, finally I seem to understand the way the component attributes work.


- Attributes with gray blackground are not readable nor settable.

- Those in black text are requestable but not changable

- Those in green can be read and written.


OK, I'm still a rookie on the Nextion...


Hi Andreas


A long time ago, the attributes weren't handled the way they are now.  This was since fixed.

Gray attributes means are the ones with drop down options in the editor.

They are like those in black - read but not write.


ie: get page0.sta will return a numeric value


1 person likes this

I am now reviewing all of the Feature Requests, this will take some time, patience please.

By manual, using Bring Bottom/Bring Top has been implemented

Can someone explain what bring bottom/bring top actually do?

I just lost a bunch of time on a project I'm working on because the ids of some waveform controls changed without any apparent action on my part (I'd done a lot of things with other controls on that page but not the waveforms).  But I did click bring bottom or bring top (can't remember which) and maybe that was the cause?

I thought those functions were like z-index in CSS or "bring to front"/"send to rear" in visual studio, but maybe not?

And I can't find those functions documented anywhere... except of course in the manual where it says the up and down arrows represent bring top / bring bottom but that doesn't help.

 

Hey Eric

The Page Component is always component .id 0

Each of the remaining components is number sequentially in the internal lookup table

Bring Bottom will set the component id to 1

Bring Top will set the component id to last (number of components on the page).


In the attribute pane in the editor, you can see the sequential order by pulling the dropdown down

You can also use Ctrl+click to select more than one component for Bring Bottom / Bring Top.

In this fashion, the component .ids can be ordered how you prefer.


Besides simple numbering, this sequence is the order items are refreshed in a page ref

This can play an important role if trying to layer,

- where one component is behind another, it should have a lower .id number.

PS: Layering is not recommended as it often results in flickering.


Hi Patrick, trying to follow your instruction, but  I'm not able to change order of components.....
I'm trying:
Atribute >Page0 > Dropdown Menu>  I can see all the components.
  I can go Up/Down with cursors,  but any Click or Ctrl+CLick Opens the component. No way to select more than one,  and do not know how to send single component Botton or Top
Can you please elaborate (for silly ones like me) the method to do it ?

 

Do not do this from the dropdown box.


If I right-click an item in the design area of the screen, hold control and right-click another

- I will have two items selected, continue this pattern - I can select many


On the tool bar at the top of the Nextion Editor window,

 - Arrow Up (Bring top) will set the id of the selected component to the last id (# of components)

 - Arrow Down (Bring bottom) will set the id of the selected component to 1


Thanks Patrick,  I havent 'seen'  this toolbar!!
  Also very interesting are the align/size options..
Regards

 

hi

I have designed a display with multiple pages, but each page id is 0.

when i need to communicate this display with my MCU how will it distinguish 2 component having same id and name but are on different pages.

or is there any other way to assign id to a page. 

  

Login or Signup to post a comment