View Full Version : TreePanel: Need return value from SubmitNodes()

Apr 01, 2011, 2:51 PM

I need to retrieve a return value (some server-side generated id) upon SubmitNodes() of a TreePanel. Is this possible somehow?

Here's my markup(simplyfied):

<ext:TreePanel runat="server" ID="TreePanel1" Lines="true" OnSubmit="TreePanel1_SubmitNodes">
<ext:Tool Type="Save" Qtip="Save" Handler="#{TreePanel1}.submitNodes();" />

and code:

protected void TreePanel1_SubmitNodes(object sender, SubmitEventArgs e)
// do something

return; // need return value here

I know it's not possible to return something directly there. But is there any other way to get data back to the browser without an extra roundtrip?

Any help appreticated!

Apr 06, 2011, 7:54 AM

just to let you know I solved this by manually preparing the tree nodes and then passing them to a custom DirectMethod, from which I can return a value:

Client code:

var SaveTrain = function () {
var nodes = TreePanel1.serializeTree();
Ext.net.DirectMethods.SaveTree(nodes, {
success: function (guid) {
TreePanel1.getRootNode().attributes["contextId"] = guid;
eventMask: { showMask: true }

Server code:

public Guid SaveTree(SubmittedNode node)
// Do something
return Guid.NewGuid();