Using Smart GWT 3.0 nightlies. Power Edition.
I have a TreeGrid where I'm allowing the user to re-order and re-parent nodes.
Unfortunately, there's no way to move a child 'leaf' or sub-folder up to the root level.
Here are the properties I set on the TreeGrid:
Since my Tree does not have a ROOT node, there's no ROOT node to drag children UP to. The UI does show an indicator that I'm dragging up to the root level, but when I let go, the UI doesn't update.
I noticed that the response being sent to the server *DOES NOT* include an update to the parentId. This appears to be the 'BUG'. When dragging nodes to other parents, the new parentId field exists in the 'values' element but I think the Smart GWT client code is not including or stripping away the parentId because it's value is NULL. But I want the parentId to be set to NULL on the backend so that the TreeGrid will show the node at the 'root' level.
Here's the update request when trying to move a child node to the root level. NOTE the omission of parentId in the values element:
Here's a transaction showing moving a child to another parent, BUT not root. NOTE the parentId IS included here with an actual value.
I have a TreeGrid where I'm allowing the user to re-order and re-parent nodes.
Unfortunately, there's no way to move a child 'leaf' or sub-folder up to the root level.
Here are the properties I set on the TreeGrid:
Code:
_tree.setCanReorderRecords(true); _tree.setCanAcceptDroppedRecords(true); _tree.setCanReparentNodes(true);
I noticed that the response being sent to the server *DOES NOT* include an update to the parentId. This appears to be the 'BUG'. When dragging nodes to other parents, the new parentId field exists in the 'values' element but I think the Smart GWT client code is not including or stripping away the parentId because it's value is NULL. But I want the parentId to be set to NULL on the backend so that the TreeGrid will show the node at the 'root' level.
Here's the update request when trying to move a child node to the root level. NOTE the omission of parentId in the values element:
Code:
<transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"> <transactionNum xsi:type="xsd:long">22</transactionNum> <operations xsi:type="xsd:List"> <elem xsi:type="xsd:Object"> <criteria xsi:type="xsd:Object"> <id xsi:type="xsd:long">37</id> </criteria> <values xsi:type="xsd:Object"> <id xsi:type="xsd:long">37</id> <open xsi:type="xsd:boolean">true</open> <title>b</title> <category xsi:type="xsd:boolean">true</category> <userId xsi:type="xsd:long">1</userId> <locked xsi:type="xsd:boolean">false</locked> <hostName>37</hostName> <children xsi:type="xsd:List"> <elem xsi:type="xsd:Object"> <id xsi:type="xsd:long">16</id> <parentId xsi:type="xsd:long">37</parentId> <open xsi:type="xsd:boolean">false</open> <title>packers_RR_7206_01</title> <category xsi:type="xsd:boolean">false</category> <userId xsi:type="xsd:long">1</userId> <hostName>packers_RR_7206_01</hostName> <device_id xsi:type="xsd:long">20</device_id> <locked xsi:type="xsd:boolean">true</locked> </elem> </children> </values> <operationConfig xsi:type="xsd:Object"> <dataSource>categoryDevice</dataSource> <operationType>update</operationType> </operationConfig> <appID>builtinApplication</appID> <operation>categoryDevice_update</operation> <oldValues xsi:type="xsd:Object"> <id xsi:type="xsd:long">37</id> <parentId xsi:type="xsd:long">38</parentId> <open xsi:type="xsd:boolean">true</open> <title>b</title> <category xsi:type="xsd:boolean">true</category> <userId xsi:type="xsd:long">1</userId> <locked xsi:type="xsd:boolean">false</locked> <hostName>37</hostName> <children xsi:type="xsd:List"> <elem xsi:type="xsd:Object"> <id xsi:type="xsd:long">16</id> <parentId xsi:type="xsd:long">37</parentId> <open xsi:type="xsd:boolean">false</open> <title>packers_RR_7206_01</title> <category xsi:type="xsd:boolean">false</category> <userId xsi:type="xsd:long">1</userId> <hostName>packers_RR_7206_01</hostName> <device_id xsi:type="xsd:long">20</device_id> <locked xsi:type="xsd:boolean">true</locked> </elem> </children> </oldValues> </elem> </operations> </transaction>
Code:
transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"> <transactionNum xsi:type="xsd:long">23</transactionNum> <operations xsi:type="xsd:List"> <elem xsi:type="xsd:Object"> <criteria xsi:type="xsd:Object"> <id xsi:type="xsd:long">37</id> </criteria> <values xsi:type="xsd:Object"> <id xsi:type="xsd:long">37</id> <parentId xsi:type="xsd:long">2</parentId> <open xsi:type="xsd:boolean">true</open> <title>b</title> <category xsi:type="xsd:boolean">true</category> <userId xsi:type="xsd:long">1</userId> <locked xsi:type="xsd:boolean">false</locked> <hostName>37</hostName> <children xsi:type="xsd:List"> <elem xsi:type="xsd:Object"> <id xsi:type="xsd:long">16</id> <parentId xsi:type="xsd:long">37</parentId> <open xsi:type="xsd:boolean">false</open> <title>packers_RR_7206_01</title> <category xsi:type="xsd:boolean">false</category> <userId xsi:type="xsd:long">1</userId> <hostName>packers_RR_7206_01</hostName> <device_id xsi:type="xsd:long">20</device_id> <locked xsi:type="xsd:boolean">true</locked> </elem> </children> </values> <operationConfig xsi:type="xsd:Object"> <dataSource>categoryDevice</dataSource> <operationType>update</operationType> </operationConfig> <appID>builtinApplication</appID> <operation>categoryDevice_update</operation> <oldValues xsi:type="xsd:Object"> <id xsi:type="xsd:long">37</id> <parentId xsi:type="xsd:long">38</parentId> <open xsi:type="xsd:boolean">true</open> <title>b</title> <category xsi:type="xsd:boolean">true</category> <userId xsi:type="xsd:long">1</userId> <locked xsi:type="xsd:boolean">false</locked> <hostName>37</hostName> <children xsi:type="xsd:List"> <elem xsi:type="xsd:Object"> <id xsi:type="xsd:long">16</id> <parentId xsi:type="xsd:long">37</parentId> <open xsi:type="xsd:boolean">false</open> <title>packers_RR_7206_01</title> <category xsi:type="xsd:boolean">false</category> <userId xsi:type="xsd:long">1</userId> <hostName>packers_RR_7206_01</hostName> <device_id xsi:type="xsd:long">20</device_id> <locked xsi:type="xsd:boolean">true</locked> </elem> </children> </oldValues> </elem> </operations> </transaction>
Comment