diff --git a/o2web/source/x_component_service_InvokeDesigner/Invoke.js b/o2web/source/x_component_service_InvokeDesigner/Invoke.js index 84753db4c17b47d2223d33c2d94aef681817f472..78644ff74125ab3e000eb03fc6982776c77dee6b 100644 --- a/o2web/source/x_component_service_InvokeDesigner/Invoke.js +++ b/o2web/source/x_component_service_InvokeDesigner/Invoke.js @@ -241,7 +241,7 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({ if(this.page){ this.designer.propertyRequireBodyNode.set("value", this.page.requireBody || ""); - this.designer.propertyRunResultNode.set("html", this.page.executeResult || ""); + this.designer.propertyRunResultNode.set("text", this.page.executeResult || ""); } this.setButton() diff --git a/o2web/source/x_component_service_InvokeDesigner/Main.js b/o2web/source/x_component_service_InvokeDesigner/Main.js index 90c6ea40a94b35a618935c37b6929b313439e452..7ec9fe533de12bb44c4dd16d0e000cbcefbd8091 100644 --- a/o2web/source/x_component_service_InvokeDesigner/Main.js +++ b/o2web/source/x_component_service_InvokeDesigner/Main.js @@ -666,33 +666,74 @@ MWF.xApplication.service.InvokeDesigner.Main = new Class({ }catch(e) { } - if( id )o2.Actions.load("x_program_center").InvokeAction.execute( alias || name || id, bodyJson || body, function (json) { - var result; - try{ - result = JSON.stringify(json, null, 4); - }catch (e) { - result = json; - } - if(this.currentPage){ - this.currentPage.executeResult = result; - } - this.propertyRunResultNode.set("html",result); - - this.notice( this.lp.runSuccess, "success"); - }.bind(this), function (xhr) { - var result; - try{ - result = JSON.stringify(xhr.responseText, null, 4); - }catch (e) { - result = xhr.responseText; - } - if(this.currentPage){ - this.currentPage.executeResult = result; - } - this.propertyRunResultNode.set("html",result); + if( id ){ + var address = o2.Actions.getHost("x_program_center"); + var serviceName = o2.Actions.load("x_program_center").InvokeAction.action.serviceName; + var uri = o2.Actions.load("x_program_center").InvokeAction.action.actions.execute.uri; + var url = uri.replace("{flag}", alias || name || id); + var res = new Request({ + url: address + "/" + serviceName + url, + async: false, + method: "POST", + onSuccess: function(responseText, responseXML){ + var result; + try{ + var json = JSON.parse( responseText ); + result = JSON.stringify(json, null, 4); + }catch (e) { + result = responseText; + } + if(this.currentPage){ + this.currentPage.executeResult = result; + } + this.propertyRunResultNode.set("text",result); - // this.notice("request processToolbars error: "+xhr.responseText, "error"); - }.bind(this)); + this.notice( this.lp.runSuccess, "success"); + }.bind(this), + onFailure: function(xhr){ + var result; + try{ + result = JSON.stringify(xhr.responseText, null, 4); + }catch (e) { + result = xhr.responseText; + } + if(this.currentPage){ + this.currentPage.executeResult = result; + } + this.propertyRunResultNode.set("text",result); + }.bind(this) + }); + res.setHeader("Content-Type", "application/json; charset=utf-8"); + res.setHeader("Accept", "text/html,application/json,*/*"); + res.setHeader("Accept-Language", o2.languageName); + res.send( bodyJson || body ); + } + + // if( id )o2.Actions.load("x_program_center").InvokeAction.execute( alias || name || id, bodyJson || body, function (json) { + // var result; + // try{ + // result = JSON.stringify(json, null, 4); + // }catch (e) { + // result = json; + // } + // if(this.currentPage){ + // this.currentPage.executeResult = result; + // } + // this.propertyRunResultNode.set("html",result); + // + // this.notice( this.lp.runSuccess, "success"); + // }.bind(this), function (xhr) { + // var result; + // try{ + // result = JSON.stringify(xhr.responseText, null, 4); + // }catch (e) { + // result = xhr.responseText; + // } + // if(this.currentPage){ + // this.currentPage.executeResult = result; + // } + // this.propertyRunResultNode.set("html",result); + // }.bind(this)); }.bind(this)); this.propertyExecuteButton.setStyle("margin","0px");