Listview item-template keeps forgetting reference

Unity 2023.3.0b3: Listview item-template keeps forgetting the Visual Tree Asset I drag onto it in UI builder. When I drag MapItem.uxml onto it, I get this line added to the uxml containing the Listview: <ui:ListView name="statesListView" fixed-item-height="60" item-template="MapItem" binding-source-selection-mode="AutoAssign" />

This works when I close UI builder.

However, when I then close/re-open Unity it does not work anymore. While nothing changes in the uxml containing the listview, when I open it in UI builder the item-template field shows “null”.

As a workaround, I can add that item-template asset as an invisible dummy VisualElement into the uxml containing the listview, which adds the following into this uxml:

<ui:Template name="MapItem" src="project://database/Assets/UI/Assets/MapItem.uxml?fileID=9197481963319205126&guid=51bf3cb1f2bfa60428cfa98ccf64db36&type=3#MapItem" />
<ui:Instance template="MapItem" name="InvisibleDummySoListViewDoesNotForgetItemTemplate" style="display: none;" />

Any way to get this working without such a silly workaround? (@cpalma-unity?)

Bumping this to make sure it doesn’t go unnoticed because this is extremely annoying.

1 Like

Please report this issue using Help -> Report a Bug in Unity. Looks like this is a regression introduced by the new UxmlSerialization system. Thanks!

How about a Unity employee creates a ticket in your internal bug reporting? It is YOUR product, you get payed for improving it, and reproducibility is trivial for this bug (just drag a VE on item template and observe what is serialized in UXML.

2 Likes

Seems someone else did report this already and it is being tracked. We do, also, report bugs internally ourselves. The reason we ask you to report the bugs is because that way you get notified when it’s fixed, or when we have further questions, or whatever the resolution ends up being. We will not make such updates on forum posts.

And yes, this example was trivial to repro, but in general, you have a much better context on the issue to create a repro case than we do, especially if it’s specific to your project.

If It’s being tracked is there a bug to follow publicly for those of us waiting on a fix?

Here’s the issue tracker link: Unity Issue Tracker - &quot;Item Template&quot; parameter field value resets in the UI Builder after reimporting the document

The issue was fixed in 6000.0.0b15. Let us know if you’re still facing similar issues.