You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looked at the source.
Code test uniqueness on element.id but, as is, 'id' in tags is not mandatory.
I think that is way text and interaction tags are not handled.
But I see that image tag in nifty-editor terminal log have id="".
So, if code test IDgenerator.isUnique() there can be just one tag with id="". Correct ?
If it is correct my proposal is new transient field with generated key. That key is unique. If it is needed.
Code can then test for id uniqueness but not require that 'id' is not empty or null.
The text was updated successfully, but these errors were encountered:
Hello, first of all thank you for digging into the code! you are brave 😄 !!! I wrote the code at least one year ago so I don't have a very clear view of the system, sorry. As far as I can tell the id uniqueness is mandatory for the right binding between GElement model and Nifty-gui internal Element instances. So no, the id field shouldn't be optional and should be present both on the Element ( the image tag ) and the GElement itself. I think that the default behavior in the case there's no id attribute is to generate one using the IDgenerator.
Now the real problem: the text and interaction tag are skipped in the loading level, have a look at GUIReader. The unknown elements are not added to the GUI instance, so when you save again the file they disappear.
Looked at the source.
Code test uniqueness on element.id but, as is, 'id' in tags is not mandatory.
I think that is way text and interaction tags are not handled.
But I see that image tag in nifty-editor terminal log have id="".
So, if code test IDgenerator.isUnique() there can be just one tag with id="". Correct ?
If it is correct my proposal is new transient field with generated key. That key is unique. If it is needed.
Code can then test for id uniqueness but not require that 'id' is not empty or null.
The text was updated successfully, but these errors were encountered: