PDA

View Full Version : windowreferencefield resetting link on initialization



joshuha
July 23rd, 2007, 03:24
Trying to make a linked field on a character sheet I am working on. The link copies from the module fine and works perfectly until I reopen the character sheet.

So, after dragging a link from the Players Module over the DB node in the windowlist looks like this:



<edges idcounter="9">
<id-00008>
<link type="windowreference">
<class>sw_referencefeat</class>
<recordname>reference.edges.description.block@SW Player Rules</recordname>
</link>
<name type="string">Block</name>
</id-00008>
</edges>


This link works fine from within the windowlist on the character sheet and can open the associate record with no issues.
I close the charactersheet, issue a /save and checked the db.xml and everything is still fine.

As soon as I reopen the character sheet though and click on the tab containing the windowlist, do a /save, the link no longer functions (brings up a blank window since the recordname is gone).



<edges idcounter="9">
<id-00008>
<link type="windowreference">
<class>sw_referencefeat</class>
<recordname></recordname>
</link>
<name type="string">Block</name>
</id-00008>
</edges>


I do not have any code in the onInit event for either the windowlist or the windowclass for the entries and it is defined as a windowreferencefield. Is this a bug or am I doing something wrong?

joshuha
July 23rd, 2007, 03:34
Figured it out so ignore this post.

If anyone is interested, when setting the windowreference class/recordname manually via the onDrop event do not specify a base class in the XML of the windowreferencecontrol. When you do this it apparently recreates the whole class/recordname node again even if a value is already in there.