Page 1 of 1

[ADDED in 2.52]Retaining Actions When Renaming Objects in CrossUI

Posted: Wed Feb 07, 2024 10:07 am
by romain
Hello CrossUI Community,

I've been working with CrossUI for a week and it's been fantastic. However, I've encountered an issue where renaming an object results in the loss of associated actions. The workaround of search/replace in the source code is quite cumbersome. Is there a better way to rename objects without losing actions, or is this an area for potential improvement in CrossUI?

Appreciate any advice or updates on this matter. Thank you!
:)

Re: Retaining Actions When Renaming Objects in CrossUI

Posted: Thu Feb 08, 2024 3:02 pm
by support
Once you rename the object name, it becomes a code-level issue. So we have to replace all the old names with the new names in the script code.

In javascript, two basic ways to reference names, which makes it difficult to replace all names correctly. We have tried that, but the result is not good.
  1. host.parent.name
  2. host.parent["name"]
  3. host["parent"]["name"]
So, suggest renaming objects as early as you can, it is best to change the object when it is first created or before you reference it. Or you have to replace the name manually.

Re: Retaining Actions When Renaming Objects in CrossUI

Posted: Thu Feb 08, 2024 4:17 pm
by support
For the JSON-like configuration actions, we can sync the alias names later.