When Preserve Identities is set to false, widgets in Px pages do not have user-assigned names. The names
of child slots are auto-generated by their parent components, and
those names are not visible to you, the user of the Px Editor. Let’s
create the following example:
- With Preserve Identities set to false,
create a new .px file and open it in the Px Editor.
- In the Px Properties side bar, create a gx:Brush property named labelBackground and give it
a value of lightGreen. For more details, see
the How to use Px Properties section.
- Add two labels to the Px page's CanvasPane. Give them the
text "My Label One" and "My Label Two".
- Select both, right-click one, and choose Edit
Properties. Right-click background and choose , and click OK.
Both labels should turn light green.
- Save the Px Editor.
Notice that the labels can be seen in the Widget
Tree. The differing text of the labels are shown, but they
are otherwise indistinguishable. They are both Labels, so the name
for both is just Label.
- Right-click on one of the labels and notice that there
is no Rename command. This is because with
Preserve Identities set to false, you cannot edit
the names of widgets in Px pages.
Let's take a look at how they are stored:
From the
Px Editor menu, select Goto Source XML.
In the source XML, you see entries for
your CanvasPane and its child Labels. Note that the <Label> tags are named Label and Label1. With Preserve Identities disabled, widgets do not have user-configured
names. Their names are auto-generated. The default behavior for auto-generating
a slot name is to simply name it the same as its type with numbers
appended for duplicates, so slot names for labels are Label, Label1, Label2, etc.
If you examine the <properties> section, you can see that
these auto-generated slot names are also used to target the Px Properties.