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

Post new features wanted for Builder or Designer here
Locked
romain
Posts: 30
Joined: Wed Jan 31, 2024 3:24 pm

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

Post 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!
:)
support
Posts: 18
Joined: Thu Jan 25, 2024 4:58 pm

Re: Retaining Actions When Renaming Objects in CrossUI

Post 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.
support
Posts: 18
Joined: Thu Jan 25, 2024 4:58 pm

Re: Retaining Actions When Renaming Objects in CrossUI

Post by support »

For the JSON-like configuration actions, we can sync the alias names later.
Locked