Class RPCRequest
- All Implemented Interfaces:
HasHandlers
RPCManager.sendRequest() method. If you use the RPCManager.send() method, an instance of RPCRequest will be created for you.-
Field Summary
Fields inherited from class com.smartgwt.client.core.RefDataClass
idFields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandownloadCallback(RPCResponse response, Map data, String fileName, String type, RPCRequest request) Overrides RPCManager.actionURL for this request only.Advanced flag to avoid a potential memory leak in Internet Explorer 9 for requests with JSON formatted responses.For xmlHttp transport + httpMethod: "GET" only, set to true to force a conditional GET request even if the browser thinks it has a current cached response.For use only with thescriptIncludetransport, this attribute specifies the name of the URL parameter which is used to specify the callback function that the server is expected to call by writing out JavaScript code.For use duringRelogin, this property marks this request an attempt to login, therefore a response containing theloginRequiredMarkeris a normal condition and should result in the status codeSTATUS_LOGIN_INCORRECTrather than a call tologinRequired().Valid with the xmlHttpRequest transport only and only whenhttpMethodis set to "POST".getData()Returns the payload of this request to be sent to the server, as a JavaScriptObject.If enabled, causes the RPCRequest to download the requested resource as a file, either showing the browser's Save dialog or displaying the file-content ina new browser window.WhendownloadResultis true, setting this attribute to true causes the content of the downloaded file to be displayed in a new browser window.This works similarly toserverOutputAsStringexcept the resulting String is automatically evaluated as JavaScript.HTTP headers to send, as a Object mapping Header name -> Header value, eg
{ "Content-Type" : "text/xml" }Selects the HTTP method that will be used for the request.The proxy URL to use for this request (ifuseHttpProxyis set for this request).When set to true, no reply is expected from the server.Is this a background request?If enabled and request is applied toRPCManager.cacheScreens()orRPCManager.loadScreen()indicates that referenced DataSources should be loaded in mock mode.If enabled, the server omits any key/value pairs in map that have null values from the response.static RPCRequestgetOrCreateRef(JavaScriptObject jsObj) Values to be sent as simple HTTP params, as a JavaScript Object where each property/value pair will become an HTTP parameter name and value.Overrides RPCManager.defaultPrompt for this request only.Controls the cursor shown whenpromptStyleis set to"cursor"for this request only.intOverrides RPCManager.promptDelay for this request only.Controls the prompt style for this request only.Whether errors during download should be reported inside the document, rather than through thenormal mechanism.When set to true, this request is sent to the server immediately, bypassing any current queue.Setting this flag makes the body of the HTTP response available as a String in thecallbackasRPCResponse.data.OverridesRPCManager.showPromptfor this request only.IfevalResultis set, setting this property to true causesCanvas.autoDrawto be set to false for the duration of the result evaluation - which is generally what you want if you're returning new components from the server.Sets the timeout on this request.Selects the transport used for this RPCRequest.booleanIf true, an image is shown to the right of the cursor whenpromptStyleis set to "cursor", otherwise the cursor itself is modified via css to the value ofpromptCursor.Indicates whether this request should use the HttpProxyServlet in order to enable contacting hosts other than the origin server (available only in Pro Edition or better).When set to true, assume the request is not going to the Smart GWT server, and hence send a simple HTTP request that does not use Smart GWT-specific request encoding.If set true, tells the server to use strict JSON format when serializing the response data.With willHandleError:false, rpcResponses that indicate an error go through centralized handling in the RPCManager and rpcRequest.callback is never invoked.In browsers that support Cross-Origin Resource Sharing and XMLHttpRequest 2, and where the service at theactionURLallows the origin to send credentials (seeAccess-Control-Allow-Credentials), should user credentials such as cookies, HTTP authentication, and client-side SSL certificates be sent with the actual CORS request?protected static booleanisDSRequest(JavaScriptObject jsObj) setActionURL(String actionURL) Overrides RPCManager.actionURL for this request only.setAllowIE9Leak(Boolean allowIE9Leak) Advanced flag to avoid a potential memory leak in Internet Explorer 9 for requests with JSON formatted responses.setBypassCache(Boolean bypassCache) For xmlHttp transport + httpMethod: "GET" only, set to true to force a conditional GET request even if the browser thinks it has a current cached response.setCallbackParam(String callbackParam) For use only with thescriptIncludetransport, this attribute specifies the name of the URL parameter which is used to specify the callback function that the server is expected to call by writing out JavaScript code.setContainsCredentials(Boolean containsCredentials) For use duringRelogin, this property marks this request an attempt to login, therefore a response containing theloginRequiredMarkeris a normal condition and should result in the status codeSTATUS_LOGIN_INCORRECTrather than a call tologinRequired().setContentType(String contentType) Valid with the xmlHttpRequest transport only and only whenhttpMethodis set to "POST".voidsetData(JavaScriptObject data) This attribute specifies the payload of the RPCRequest.This attribute specifies the payload of the RPCRequest.This attribute specifies the payload of the RPCRequest.This attribute specifies the payload of the RPCRequest.setDownloadResult(Boolean downloadResult) If enabled, causes the RPCRequest to download the requested resource as a file, either showing the browser's Save dialog or displaying the file-content ina new browser window.setDownloadToNewWindow(Boolean downloadToNewWindow) WhendownloadResultis true, setting this attribute to true causes the content of the downloaded file to be displayed in a new browser window.setEvalResult(Boolean evalResult) This works similarly toserverOutputAsStringexcept the resulting String is automatically evaluated as JavaScript.setEvalVars(Map evalVars) If you've setevalResult: true, then the property values of this object will be available in the evaluation scope of the result under the variable names specified by the property names.setHttpHeaders(Map httpHeaders) HTTP headers to send, as a Object mapping Header name -> Header value, eg
{ "Content-Type" : "text/xml" }setHttpMethod(String httpMethod) Selects the HTTP method that will be used for the request.setHttpProxyURL(String httpProxyURL) The proxy URL to use for this request (ifuseHttpProxyis set for this request).setIgnoreTimeout(Boolean ignoreTimeout) When set to true, no reply is expected from the server.setIsBackgroundRequest(Boolean isBackgroundRequest) Is this a background request?setMockMode(Boolean mockMode) If enabled and request is applied toRPCManager.cacheScreens()orRPCManager.loadScreen()indicates that referenced DataSources should be loaded in mock mode.setOmitNullMapValuesInResponse(Boolean omitNullMapValuesInResponse) If enabled, the server omits any key/value pairs in map that have null values from the response.Values to be sent as simple HTTP params, as a JavaScript Object where each property/value pair will become an HTTP parameter name and value.Overrides RPCManager.defaultPrompt for this request only.setPromptCursor(String promptCursor) Controls the cursor shown whenpromptStyleis set to"cursor"for this request only.setPromptDelay(int promptDelay) Overrides RPCManager.promptDelay for this request only.setPromptStyle(PromptStyle promptStyle) Controls the prompt style for this request only.setReportDownloadErrorsAsDocuments(Boolean reportDownloadErrorsAsDocuments) Whether errors during download should be reported inside the document, rather than through thenormal mechanism.setSendNoQueue(Boolean sendNoQueue) When set to true, this request is sent to the server immediately, bypassing any current queue.setServerOutputAsString(Boolean serverOutputAsString) Setting this flag makes the body of the HTTP response available as a String in thecallbackasRPCResponse.data.setShowPrompt(Boolean showPrompt) OverridesRPCManager.showPromptfor this request only.setSuppressAutoDraw(Boolean suppressAutoDraw) IfevalResultis set, setting this property to true causesCanvas.autoDrawto be set to false for the duration of the result evaluation - which is generally what you want if you're returning new components from the server.setTimeout(Integer timeout) Sets the timeout on this request.setTransport(RPCTransport transport) Selects the transport used for this RPCRequest.setUseCursorTracker(boolean useCursorTracker) If true, an image is shown to the right of the cursor whenpromptStyleis set to "cursor", otherwise the cursor itself is modified via css to the value ofpromptCursor.setUseHttpProxy(Boolean useHttpProxy) Indicates whether this request should use the HttpProxyServlet in order to enable contacting hosts other than the origin server (available only in Pro Edition or better).setUseSimpleHttp(Boolean useSimpleHttp) When set to true, assume the request is not going to the Smart GWT server, and hence send a simple HTTP request that does not use Smart GWT-specific request encoding.setUseStrictJSON(Boolean useStrictJSON) If set true, tells the server to use strict JSON format when serializing the response data.setWillHandleError(Boolean willHandleError) With willHandleError:false, rpcResponses that indicate an error go through centralized handling in the RPCManager and rpcRequest.callback is never invoked.setWithCredentials(Boolean withCredentials) In browsers that support Cross-Origin Resource Sharing and XMLHttpRequest 2, and where the service at theactionURLallows the origin to send credentials (seeAccess-Control-Allow-Credentials), should user credentials such as cookies, HTTP authentication, and client-side SSL certificates be sent with the actual CORS request?voidxhr_onProgress(Map progressEvent, RPCRequest request) Progress event notification fired repeatedly during requests withtransportset to"xmlHttpRequest".Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetIDMethods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
-
Constructor Details
-
RPCRequest
public RPCRequest() -
RPCRequest
-
-
Method Details
-
getOrCreateRef
-
setActionURL
Overrides RPCManager.actionURL for this request only. If you're using queuing, note that queues as per-URL - in other words all RPCRequests in a queue must go to a single URL. If you attempt to send a request with an actionURL that is different from those already in the queue, it will be sent to the server separately, ahead of the queue, and a warning will be logged to the Developer Console.- Parameters:
actionURL- New actionURL value. Default value is RPCManager.actionURL- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#actionURLURL
-
getActionURL
Overrides RPCManager.actionURL for this request only. If you're using queuing, note that queues as per-URL - in other words all RPCRequests in a queue must go to a single URL. If you attempt to send a request with an actionURL that is different from those already in the queue, it will be sent to the server separately, ahead of the queue, and a warning will be logged to the Developer Console.- Returns:
- Current actionURL value. Default value is RPCManager.actionURL
- See Also:
-
com.smartgwt.client.rpc.RPCManager#actionURLURL
-
setAllowIE9Leak
Advanced flag to avoid a potential memory leak in Internet Explorer 9 for requests with JSON formatted responses.This attribute may be set to
falseto explicitly enable the workaround describedherefor this request, avoiding a potential memory leak in Internet Explorer 9.This workaround has a limitation in that if parsing the JSON response generates certain object types including JavaScript
Dateorfunctionobjects, attempts to interact with these objects can subsequently lead to a JavaScript error with the message"Can't execute code from a freed script".This workaround therefore may not be suitable for all transactions or dataSources within a given application.
This property may also be set globally within an application (via
allowIE9Leak)_.Note: This memory leak and workaround is discussed further in the online Smart GWT FAQ.
Note : This is an advanced setting
- Parameters:
allowIE9Leak- New allowIE9Leak value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
getAllowIE9Leak
Advanced flag to avoid a potential memory leak in Internet Explorer 9 for requests with JSON formatted responses.This attribute may be set to
falseto explicitly enable the workaround describedherefor this request, avoiding a potential memory leak in Internet Explorer 9.This workaround has a limitation in that if parsing the JSON response generates certain object types including JavaScript
Dateorfunctionobjects, attempts to interact with these objects can subsequently lead to a JavaScript error with the message"Can't execute code from a freed script".This workaround therefore may not be suitable for all transactions or dataSources within a given application.
This property may also be set globally within an application (via
allowIE9Leak)_.Note: This memory leak and workaround is discussed further in the online Smart GWT FAQ.
- Returns:
- Current allowIE9Leak value. Default value is null
-
setBypassCache
For xmlHttp transport + httpMethod: "GET" only, set to true to force a conditional GET request even if the browser thinks it has a current cached response.Note : This is an advanced setting
- Parameters:
bypassCache- New bypassCache value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls
-
getBypassCache
For xmlHttp transport + httpMethod: "GET" only, set to true to force a conditional GET request even if the browser thinks it has a current cached response.- Returns:
- Current bypassCache value. Default value is false
-
setCallbackParam
For use only with thescriptIncludetransport, this attribute specifies the name of the URL parameter which is used to specify the callback function that the server is expected to call by writing out JavaScript code. The actual function to call is automatically generated and differs for every request (to allow concurrency).For example, with
callbackParamset to it's default value of "callback", the server might be contacted with a URL like:loadData?callback=isc_scriptIncludeCallback_5.. then the server's response should look like:isc_scriptIncludeCallback_5({ .. data .. });The name "isc_scriptIncludeCallback_5" is automatically generated and will differ each time the server is contacted.Smart GWT makes of this server-provided callback mechanism, then calls
callbacknormally.rpcRequest.callbackParamis ignored by all transport other thanscriptInclude.- Parameters:
callbackParam- New callbackParam value. Default value is "callback"- Returns:
RPCRequestinstance, for chaining setter calls
-
getCallbackParam
For use only with thescriptIncludetransport, this attribute specifies the name of the URL parameter which is used to specify the callback function that the server is expected to call by writing out JavaScript code. The actual function to call is automatically generated and differs for every request (to allow concurrency).For example, with
callbackParamset to it's default value of "callback", the server might be contacted with a URL like:loadData?callback=isc_scriptIncludeCallback_5.. then the server's response should look like:isc_scriptIncludeCallback_5({ .. data .. });The name "isc_scriptIncludeCallback_5" is automatically generated and will differ each time the server is contacted.Smart GWT makes of this server-provided callback mechanism, then calls
callbacknormally.rpcRequest.callbackParamis ignored by all transport other thanscriptInclude.- Returns:
- Current callbackParam value. Default value is "callback"
-
setContainsCredentials
For use duringRelogin, this property marks this request an attempt to login, therefore a response containing theloginRequiredMarkeris a normal condition and should result in the status codeSTATUS_LOGIN_INCORRECTrather than a call tologinRequired().It is not required to set
containsCredentials, however, it does typically simplify relogin logic by separating the handling of RPCs that are login attempts from RPCs that are not.Note : This is an advanced setting
- Parameters:
containsCredentials- New containsCredentials value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
getContainsCredentials
For use duringRelogin, this property marks this request an attempt to login, therefore a response containing theloginRequiredMarkeris a normal condition and should result in the status codeSTATUS_LOGIN_INCORRECTrather than a call tologinRequired().It is not required to set
containsCredentials, however, it does typically simplify relogin logic by separating the handling of RPCs that are login attempts from RPCs that are not.- Returns:
- Current containsCredentials value. Default value is false
- See Also:
-
setContentType
Valid with the xmlHttpRequest transport only and only whenhttpMethodis set to "POST".- Parameters:
contentType- New contentType value. Default value is "application/x-www-form-urlencoded"- Returns:
RPCRequestinstance, for chaining setter calls
-
getContentType
Valid with the xmlHttpRequest transport only and only whenhttpMethodis set to "POST".- Returns:
- Current contentType value. Default value is "application/x-www-form-urlencoded"
-
setData
This attribute specifies the payload of the RPCRequest. When using theSmart GWT server, objects sent to the server asrequest.datawill be available on the server-sideRPCRequestobject as Java Objects. This is achieved by serializing the client side data in a JSON type format and generating Java Objects on the server from this serialized data.If the client side
request.datais set to a Java object in your SmartGWT code it will be serialized as JSON as follows:
- Numeric client side values (int, Integer, etc) will be serialized as JavaScript numbers.
- String values will be serialized as JavaScript strings.
- Date values will be serialized as JavaScript dates.
- Maps or Record objects will be serialized as JavaScript Objects.
- Arrays or Lists will become JavaScript arrays
Serialization of Maps and Arrays is recursive - each entry in an Array, or attribute on a Map will also be serialized according to the above rules.
Note that you can also setrequest.datadirectly to a JavaScriptObject, and use theJSOHelperclass orSomeObject.getJSObj()to perform your own data conversions on the client. The serialized JavaScript will then be converted back to Java on the server according to the following rules.Here are the mapping of JavaScript types to their corresponding server object types:
JS Type Java Type Object: {} Map Array: [] List String String Number Long|Double Boolean Boolean Date java.util.Date String com.smartgwt.client.types.ValueEnum
Note that the order of keys/values in the Maps created on the server is not guaranteed because JavaScript Object literals do not guarantee order.When using JPA or Hibernate Java value used can be affected by the Java Bean declaration. See
DsRequestBeanTypesfor details.Server->client conversion follows this table as well, with some extras. See the toJS() method on JSTranslater in the server documentation for a description of additional behaviors.
When not communicating with the Smart GWT server,
rpcRequest.databecomes simple HTTP parameters or an HTTP request body - seeuseSimpleHttpfor details.- Parameters:
data- New data value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCResponse#setData
-
setData
This attribute specifies the payload of the RPCRequest. When using theSmart GWT server, objects sent to the server asrequest.datawill be available on the server-sideRPCRequestobject as Java Objects. This is achieved by serializing the client side data in a JSON type format and generating Java Objects on the server from this serialized data.If the client side
request.datais set to a Java object in your SmartGWT code it will be serialized as JSON as follows:
- Numeric client side values (int, Integer, etc) will be serialized as JavaScript numbers.
- String values will be serialized as JavaScript strings.
- Date values will be serialized as JavaScript dates.
- Maps or Record objects will be serialized as JavaScript Objects.
- Arrays or Lists will become JavaScript arrays
Serialization of Maps and Arrays is recursive - each entry in an Array, or attribute on a Map will also be serialized according to the above rules.
Note that you can also setrequest.datadirectly to a JavaScriptObject, and use theJSOHelperclass orSomeObject.getJSObj()to perform your own data conversions on the client. The serialized JavaScript will then be converted back to Java on the server according to the following rules.Here are the mapping of JavaScript types to their corresponding server object types:
JS Type Java Type Object: {} Map Array: [] List String String Number Long|Double Boolean Boolean Date java.util.Date String com.smartgwt.client.types.ValueEnum
Note that the order of keys/values in the Maps created on the server is not guaranteed because JavaScript Object literals do not guarantee order.When using JPA or Hibernate Java value used can be affected by the Java Bean declaration. See
DsRequestBeanTypesfor details.Server->client conversion follows this table as well, with some extras. See the toJS() method on JSTranslater in the server documentation for a description of additional behaviors.
When not communicating with the Smart GWT server,
rpcRequest.databecomes simple HTTP parameters or an HTTP request body - seeuseSimpleHttpfor details.- Parameters:
data- New data value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCResponse#setData
-
setData
This attribute specifies the payload of the RPCRequest. When using theSmart GWT server, objects sent to the server asrequest.datawill be available on the server-sideRPCRequestobject as Java Objects. This is achieved by serializing the client side data in a JSON type format and generating Java Objects on the server from this serialized data.If the client side
request.datais set to a Java object in your SmartGWT code it will be serialized as JSON as follows:
- Numeric client side values (int, Integer, etc) will be serialized as JavaScript numbers.
- String values will be serialized as JavaScript strings.
- Date values will be serialized as JavaScript dates.
- Maps or Record objects will be serialized as JavaScript Objects.
- Arrays or Lists will become JavaScript arrays
Serialization of Maps and Arrays is recursive - each entry in an Array, or attribute on a Map will also be serialized according to the above rules.
Note that you can also setrequest.datadirectly to a JavaScriptObject, and use theJSOHelperclass orSomeObject.getJSObj()to perform your own data conversions on the client. The serialized JavaScript will then be converted back to Java on the server according to the following rules.Here are the mapping of JavaScript types to their corresponding server object types:
JS Type Java Type Object: {} Map Array: [] List String String Number Long|Double Boolean Boolean Date java.util.Date String com.smartgwt.client.types.ValueEnum
Note that the order of keys/values in the Maps created on the server is not guaranteed because JavaScript Object literals do not guarantee order.When using JPA or Hibernate Java value used can be affected by the Java Bean declaration. See
DsRequestBeanTypesfor details.Server->client conversion follows this table as well, with some extras. See the toJS() method on JSTranslater in the server documentation for a description of additional behaviors.
When not communicating with the Smart GWT server,
rpcRequest.databecomes simple HTTP parameters or an HTTP request body - seeuseSimpleHttpfor details.- Parameters:
data- New data value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCResponse#setData
-
setDownloadResult
If enabled, causes the RPCRequest to download the requested resource as a file, either showing the browser's Save dialog or displaying the file-content ina new browser window.Download requests will use
transport: "hiddenFrame" by default.In this mode, the download will be performed by a standard HTTP request issued by the browser. If
DSRequest.downloadToNewWindowis true, the request will be targeted against a new browser window, and if the resulting file can be displayed inline by the browser it will be. IfDSRequest.downloadToNewWindowis not true, or the browser cannot display the returned file inline, the browser will download the file and store it to the user's file system.Download requests with
transport: "hiddenFrame" do not fire any callbacks.If a developer explicitly sets
request.transportto "xmlHttpRequest", the browser will instead use an XMLHttpRequest to download the data from the server. This mode differs from hiddenFrame downloads in various ways:- Explicit
httpHeadersmay be sent to the server in this mode - Instead of automatically downloading the response to the user's filesystem,
the server response will be available as a Blob, and the
downloadCallback()will be invoked, if specified.
Returningfalsefrom the downloadCallback will suppress the default behavior of saving the file to the user's filesystem, giving developers an opportunity to take other actions, such as generating a data URL from the Blob. - xmlHttpRequest download does not have a
built-in progress bar to indicate download progress. Developers may make use of the
xhr_onProgress()event to indicate download progress if required.
Note : This is an advanced setting
- Parameters:
downloadResult- New downloadResult value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls
- Explicit
-
getDownloadResult
If enabled, causes the RPCRequest to download the requested resource as a file, either showing the browser's Save dialog or displaying the file-content ina new browser window.Download requests will use
transport: "hiddenFrame" by default.In this mode, the download will be performed by a standard HTTP request issued by the browser. If
DSRequest.downloadToNewWindowis true, the request will be targeted against a new browser window, and if the resulting file can be displayed inline by the browser it will be. IfDSRequest.downloadToNewWindowis not true, or the browser cannot display the returned file inline, the browser will download the file and store it to the user's file system.Download requests with
transport: "hiddenFrame" do not fire any callbacks.If a developer explicitly sets
request.transportto "xmlHttpRequest", the browser will instead use an XMLHttpRequest to download the data from the server. This mode differs from hiddenFrame downloads in various ways:- Explicit
httpHeadersmay be sent to the server in this mode - Instead of automatically downloading the response to the user's filesystem,
the server response will be available as a Blob, and the
downloadCallback()will be invoked, if specified.
Returningfalsefrom the downloadCallback will suppress the default behavior of saving the file to the user's filesystem, giving developers an opportunity to take other actions, such as generating a data URL from the Blob. - xmlHttpRequest download does not have a
built-in progress bar to indicate download progress. Developers may make use of the
xhr_onProgress()event to indicate download progress if required.
- Returns:
- Current downloadResult value. Default value is false
- Explicit
-
setDownloadToNewWindow
WhendownloadResultis true, setting this attribute to true causes the content of the downloaded file to be displayed in a new browser window.Note that this setting is currently incompatible with
transport:"xmlHttpRequest". See thedownloadResultdocumentation for more details on xmlHttpRequest downloadsNote : This is an advanced setting
- Parameters:
downloadToNewWindow- New downloadToNewWindow value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls
-
getDownloadToNewWindow
WhendownloadResultis true, setting this attribute to true causes the content of the downloaded file to be displayed in a new browser window.Note that this setting is currently incompatible with
transport:"xmlHttpRequest". See thedownloadResultdocumentation for more details on xmlHttpRequest downloads- Returns:
- Current downloadToNewWindow value. Default value is false
-
setEvalResult
This works similarly toserverOutputAsStringexcept the resulting String is automatically evaluated as JavaScript. The result of the evaluation is then passed to any specifiedcallbackasRPCResponse.data.This feature can be used to dynamically load new application modules into a running application. An RPCRequest with
evalResultenabled can be used to fetch a static .js file or JavaScript dynamically generated by the server. The returned JavaScript can contain anything that a JavaScript file loaded at init time can contain, including new views and new Smart GWT class definitions.Example usage with
RPCManager.sendRequest():RPCRequest rpcRequestProperties = new RPCRequest(); rpcRequestProperties.setEvalResult(true); rpcRequestProperties.setActionURL("js/loadLabel.js"); Map evalVars = new HashMap(); evalVars.put(var1, "A Value"); rpcRequestProperties.setEvalVars(evalVars); RPCManager.sendRequest(rpcRequestProperties);This call would execute the code fromloadLabel.js, and make the variablevar1available to that code. Therefore if the .js file contained this code:Label label = new Label(); label.setContents(var1);A label would be created with contents set to the value ofvar1- the string"A Value".This feature relies on the XMLHttpRequest object which can be disabled by end-users in some supported browsers. See
PlatformDependenciesfor more information.Note : This is an advanced setting
- Parameters:
evalResult- New evalResult value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
getEvalResult
This works similarly toserverOutputAsStringexcept the resulting String is automatically evaluated as JavaScript. The result of the evaluation is then passed to any specifiedcallbackasRPCResponse.data.This feature can be used to dynamically load new application modules into a running application. An RPCRequest with
evalResultenabled can be used to fetch a static .js file or JavaScript dynamically generated by the server. The returned JavaScript can contain anything that a JavaScript file loaded at init time can contain, including new views and new Smart GWT class definitions.Example usage with
RPCManager.sendRequest():RPCRequest rpcRequestProperties = new RPCRequest(); rpcRequestProperties.setEvalResult(true); rpcRequestProperties.setActionURL("js/loadLabel.js"); Map evalVars = new HashMap(); evalVars.put(var1, "A Value"); rpcRequestProperties.setEvalVars(evalVars); RPCManager.sendRequest(rpcRequestProperties);This call would execute the code fromloadLabel.js, and make the variablevar1available to that code. Therefore if the .js file contained this code:Label label = new Label(); label.setContents(var1);A label would be created with contents set to the value ofvar1- the string"A Value".This feature relies on the XMLHttpRequest object which can be disabled by end-users in some supported browsers. See
PlatformDependenciesfor more information.- Returns:
- Current evalResult value. Default value is false
- See Also:
-
ViewLoadercom.smartgwt.client.rpc.RPCRequest#getEvalVars
-
setEvalVars
If you've setevalResult: true, then the property values of this object will be available in the evaluation scope of the result under the variable names specified by the property names.So e.g. if evalVars is:
{foo: "bar"}then a reference to the variablefooin the result will evaluate to"bar".Note : This is an advanced setting
- Parameters:
evalVars- New evalVars value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
setHttpHeaders
HTTP headers to send, as a Object mapping Header name -> Header value, eg
{ "Content-Type" : "text/xml" }Valid with the xmlHttpRequest
transportonly.- Parameters:
httpHeaders- New httpHeaders value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
getHttpHeaders
HTTP headers to send, as a Object mapping Header name -> Header value, eg
{ "Content-Type" : "text/xml" }Valid with the xmlHttpRequest
transportonly.- Returns:
- Current httpHeaders value. Default value is null
-
setHttpMethod
Selects the HTTP method that will be used for the request. Typical values are "POST" and "GET".The more obscure "PUT", "DELETE" and "HEAD" methods are also valid, however, none of these are supported by the Safari browser previous to version 3.0.
- Parameters:
httpMethod- New httpMethod value. Default value is "POST"- Returns:
RPCRequestinstance, for chaining setter calls
-
getHttpMethod
Selects the HTTP method that will be used for the request. Typical values are "POST" and "GET".The more obscure "PUT", "DELETE" and "HEAD" methods are also valid, however, none of these are supported by the Safari browser previous to version 3.0.
- Returns:
- Current httpMethod value. Default value is "POST"
-
setHttpProxyURL
The proxy URL to use for this request (ifuseHttpProxyis set for this request). If unset, the value ofhttpProxyURLwill be used instead.- Parameters:
httpProxyURL- New httpProxyURL value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#httpProxyURL
-
getHttpProxyURL
The proxy URL to use for this request (ifuseHttpProxyis set for this request). If unset, the value ofhttpProxyURLwill be used instead.- Returns:
- Current httpProxyURL value. Default value is null
- See Also:
-
com.smartgwt.client.rpc.RPCManager#httpProxyURL
-
setIgnoreTimeout
When set to true, no reply is expected from the server. However, if a reply is received, it will be processed.Note: setting this to true, forces
sendNoQueuetotruefor this request.Note : This is an advanced setting
- Parameters:
ignoreTimeout- New ignoreTimeout value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls
-
getIgnoreTimeout
When set to true, no reply is expected from the server. However, if a reply is received, it will be processed.Note: setting this to true, forces
sendNoQueuetotruefor this request.- Returns:
- Current ignoreTimeout value. Default value is false
-
setIsBackgroundRequest
Is this a background request?This attribute may be set to true for requests that do not interfere with the normal flow of user interaction within an application.
Background requests are ignored by
AutoTest.waitForSystemDone(), giving automated testing tools a way to identify specific operations that should not interfere with the flow of the test, without entirely disabling the ability towait for network operations.- Parameters:
isBackgroundRequest- New isBackgroundRequest value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
getIsBackgroundRequest
Is this a background request?This attribute may be set to true for requests that do not interfere with the normal flow of user interaction within an application.
Background requests are ignored by
AutoTest.waitForSystemDone(), giving automated testing tools a way to identify specific operations that should not interfere with the flow of the test, without entirely disabling the ability towait for network operations.- Returns:
- Current isBackgroundRequest value. Default value is null
-
setMockMode
If enabled and request is applied toRPCManager.cacheScreens()orRPCManager.loadScreen()indicates that referenced DataSources should be loaded in mock mode.- Parameters:
mockMode- New mockMode value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
getMockMode
If enabled and request is applied toRPCManager.cacheScreens()orRPCManager.loadScreen()indicates that referenced DataSources should be loaded in mock mode.- Returns:
- Current mockMode value. Default value is null
-
setOmitNullMapValuesInResponse
If enabled, the server omits any key/value pairs in map that have null values from the response. This can reduce the size of the response when many fields have null values.To enable this globally for all responses you can set RPCManager.omitNullMapValuesInResponse in
server.properties.Note that
SQL DataSourcesdon't add nulls to results for null values so this flag does nothing in that case.Note : This is an advanced setting
- Parameters:
omitNullMapValuesInResponse- New omitNullMapValuesInResponse value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls
-
getOmitNullMapValuesInResponse
If enabled, the server omits any key/value pairs in map that have null values from the response. This can reduce the size of the response when many fields have null values.To enable this globally for all responses you can set RPCManager.omitNullMapValuesInResponse in
server.properties.Note that
SQL DataSourcesdon't add nulls to results for null values so this flag does nothing in that case.- Returns:
- Current omitNullMapValuesInResponse value. Default value is false
-
setParams
Values to be sent as simple HTTP params, as a JavaScript Object where each property/value pair will become an HTTP parameter name and value. These parameters are then accessible on the server, for example, using servletRequest.getParameter(paramName) in Java Servlets.Array-valued parameters will be submitted as multiple instances of the same parameter, similar to an HTML form with a multi-select (?paramName=value1¶mName=value2 ...), accessible as getParameterValues(paramName) in Java Servlets. Any non-atomic type, such as an Object, will be serialized to JSON by the
JSONEncoder. If this isn't desirable, serialize the data in advance so that the value provided inrpcRequest.paramsis a String.Note that this API is primarily used in combination with
useSimpleHttp- when contacting the Smart GWT Server, usedatainstead, which provides full JavaScript <-> Java translation of arbitrary structures.rpcRequest.paramscan also be used with the Smart GWT Server, where it provides an an opportunity to send additional data aside from the maindatapayload. This is useful for adding data to DataSource requests which will be kept separate from the automatically sent DataSource data, or for making parts of the request visible in the URL for HTTP-level logging or layer 4 switches.Note that in contrast to
dataobject, the data inrpcRequest.paramsis not deserialized by the Smart GWT server, and all values arrive on the server as String type (like HTTP parameters always do).Note: The params are submitted once per http transaction. If you are using
request queuingto bundle multiple RPCRequests or DSRequests into a single HTTP turnaround, the params from the various RPCRequests will be merged, with the later-queued transactions winning on parameter name collisions. A warning will be logged in the Developer Console if multiple RPCRequests specified params.- Parameters:
params- New params value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
getParams
Values to be sent as simple HTTP params, as a JavaScript Object where each property/value pair will become an HTTP parameter name and value. These parameters are then accessible on the server, for example, using servletRequest.getParameter(paramName) in Java Servlets.Array-valued parameters will be submitted as multiple instances of the same parameter, similar to an HTML form with a multi-select (?paramName=value1¶mName=value2 ...), accessible as getParameterValues(paramName) in Java Servlets. Any non-atomic type, such as an Object, will be serialized to JSON by the
JSONEncoder. If this isn't desirable, serialize the data in advance so that the value provided inrpcRequest.paramsis a String.Note that this API is primarily used in combination with
useSimpleHttp- when contacting the Smart GWT Server, usedatainstead, which provides full JavaScript <-> Java translation of arbitrary structures.rpcRequest.paramscan also be used with the Smart GWT Server, where it provides an an opportunity to send additional data aside from the maindatapayload. This is useful for adding data to DataSource requests which will be kept separate from the automatically sent DataSource data, or for making parts of the request visible in the URL for HTTP-level logging or layer 4 switches.Note that in contrast to
dataobject, the data inrpcRequest.paramsis not deserialized by the Smart GWT server, and all values arrive on the server as String type (like HTTP parameters always do).Note: The params are submitted once per http transaction. If you are using
request queuingto bundle multiple RPCRequests or DSRequests into a single HTTP turnaround, the params from the various RPCRequests will be merged, with the later-queued transactions winning on parameter name collisions. A warning will be logged in the Developer Console if multiple RPCRequests specified params.- Returns:
- Current params value. Default value is null
-
setPrompt
Overrides RPCManager.defaultPrompt for this request only. If you're using queuing, note that the prompt string from the first request in the queue is the one that is shown to the user.- Parameters:
prompt- New prompt value. Default value is RPCManager.defaultPrompt- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#defaultPromptcom.smartgwt.client.rpc.RPCManager#showPromptcom.smartgwt.client.rpc.RPCManager#promptStylecom.smartgwt.client.rpc.RPCManager#promptCursorsetShowPrompt(java.lang.Boolean)setPromptStyle(com.smartgwt.client.types.PromptStyle)setPromptCursor(java.lang.String)HTMLStringRpcPrompt overview and related methods
-
getPrompt
Overrides RPCManager.defaultPrompt for this request only. If you're using queuing, note that the prompt string from the first request in the queue is the one that is shown to the user.- Returns:
- Current prompt value. Default value is RPCManager.defaultPrompt
- See Also:
-
com.smartgwt.client.rpc.RPCManager#defaultPromptcom.smartgwt.client.rpc.RPCManager#showPromptcom.smartgwt.client.rpc.RPCManager#promptStylecom.smartgwt.client.rpc.RPCManager#promptCursorgetShowPrompt()getPromptStyle()getPromptCursor()HTMLStringRpcPrompt overview and related methods
-
setPromptCursor
Controls the cursor shown whenpromptStyleis set to"cursor"for this request only. Defaults topromptCursor.- Parameters:
promptCursor- New promptCursor value. Default value is "progress"- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#promptCursorRpcPrompt overview and related methods
-
getPromptCursor
Controls the cursor shown whenpromptStyleis set to"cursor"for this request only. Defaults topromptCursor.- Returns:
- Current promptCursor value. Default value is "progress"
- See Also:
-
com.smartgwt.client.rpc.RPCManager#promptCursorRpcPrompt overview and related methods
-
setPromptDelay
Overrides RPCManager.promptDelay for this request only. Defaults topromptDelay.If you're using queuing, note that the promptDelay of the first request is used for the entire queue.
Note : This is an advanced setting
- Parameters:
promptDelay- New promptDelay value. Default value is RPCManager.promptDelay- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
setShowPrompt(java.lang.Boolean)com.smartgwt.client.rpc.RPCManager#promptDelayRpcPrompt overview and related methods
-
getPromptDelay
public int getPromptDelay()Overrides RPCManager.promptDelay for this request only. Defaults topromptDelay.If you're using queuing, note that the promptDelay of the first request is used for the entire queue.
- Returns:
- Current promptDelay value. Default value is RPCManager.promptDelay
- See Also:
-
getShowPrompt()com.smartgwt.client.rpc.RPCManager#promptDelayRpcPrompt overview and related methods
-
setPromptStyle
Controls the prompt style for this request only. Defaults topromptStyle.- Parameters:
promptStyle- New promptStyle value. Default value is RPCManager.promptStyle- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#promptStyleRpcPrompt overview and related methods
-
getPromptStyle
Controls the prompt style for this request only. Defaults topromptStyle.- Returns:
- Current promptStyle value. Default value is RPCManager.promptStyle
- See Also:
-
com.smartgwt.client.rpc.RPCManager#promptStyleRpcPrompt overview and related methods
-
setReportDownloadErrorsAsDocuments
Whether errors during download should be reported inside the document, rather than through thenormal mechanism. If unset, this will be defaulted fromreportDownloadErrorsAsDocuments.- Parameters:
reportDownloadErrorsAsDocuments- New reportDownloadErrorsAsDocuments value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
getReportDownloadErrorsAsDocuments
Whether errors during download should be reported inside the document, rather than through thenormal mechanism. If unset, this will be defaulted fromreportDownloadErrorsAsDocuments.- Returns:
- Current reportDownloadErrorsAsDocuments value. Default value is null
-
setSendNoQueue
When set to true, this request is sent to the server immediately, bypassing any current queue.Note : This is an advanced setting
- Parameters:
sendNoQueue- New sendNoQueue value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls
-
getSendNoQueue
When set to true, this request is sent to the server immediately, bypassing any current queue.- Returns:
- Current sendNoQueue value. Default value is false
-
setServerOutputAsString
Setting this flag makes the body of the HTTP response available as a String in thecallbackasRPCResponse.data. This is typically only useful if you are sending a request that will not be received by the Smart GWT Java Server, however in that case, setuseSimpleHttp:true instead, which impliesserverOutputAsString:true.serverOutputAsString:trueallows you to, for example, load the contents of static files off your webserver into a string for processing on the client with no server support. TheactionURLmust be in the same domain as the current page for this to work.This feature relies on the XMLHttpRequest object which can be disabled by end-users in some supported browsers. See
PlatformDependenciesfor more information.Generally this API is used for either
non-Java backendsor for advanced usage such as content that requires processing before it can be used in Smart GWT components (such as client-side web scraping). Note that Smart GWT provides higher-level APIs for loading common types of data, see egHTMLFlowfor HTML content,ViewLoaderfor loading Smart GWT components,XMLTools.loadXML()for loading XML,evalResultfor loading JSON, andDataSourcefor loading structured data in various formats.Note : This is an advanced setting
- Parameters:
serverOutputAsString- New serverOutputAsString value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls
-
getServerOutputAsString
Setting this flag makes the body of the HTTP response available as a String in thecallbackasRPCResponse.data. This is typically only useful if you are sending a request that will not be received by the Smart GWT Java Server, however in that case, setuseSimpleHttp:true instead, which impliesserverOutputAsString:true.serverOutputAsString:trueallows you to, for example, load the contents of static files off your webserver into a string for processing on the client with no server support. TheactionURLmust be in the same domain as the current page for this to work.This feature relies on the XMLHttpRequest object which can be disabled by end-users in some supported browsers. See
PlatformDependenciesfor more information.Generally this API is used for either
non-Java backendsor for advanced usage such as content that requires processing before it can be used in Smart GWT components (such as client-side web scraping). Note that Smart GWT provides higher-level APIs for loading common types of data, see egHTMLFlowfor HTML content,ViewLoaderfor loading Smart GWT components,XMLTools.loadXML()for loading XML,evalResultfor loading JSON, andDataSourcefor loading structured data in various formats.- Returns:
- Current serverOutputAsString value. Default value is false
-
setShowPrompt
OverridesRPCManager.showPromptfor this request only.If you're using queuing, note that if any of the requests in the queue specify showPrompt:true, then a prompt will be shown for the entire queue with the prompt text of the first request in the queue to specify a custom prompt if promptStyle is set to "dialog".
If promptStyle is set to "cursor" for the request that specified showPrompt: true, then the entire queue uses the "cursor" style for the prompt.
- Parameters:
showPrompt- New showPrompt value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#showPromptsetPromptStyle(com.smartgwt.client.types.PromptStyle)RpcPrompt overview and related methods
-
getShowPrompt
OverridesRPCManager.showPromptfor this request only.If you're using queuing, note that if any of the requests in the queue specify showPrompt:true, then a prompt will be shown for the entire queue with the prompt text of the first request in the queue to specify a custom prompt if promptStyle is set to "dialog".
If promptStyle is set to "cursor" for the request that specified showPrompt: true, then the entire queue uses the "cursor" style for the prompt.
- Returns:
- Current showPrompt value. Default value is null
- See Also:
-
com.smartgwt.client.rpc.RPCManager#showPromptgetPromptStyle()RpcPrompt overview and related methods
-
setSuppressAutoDraw
IfevalResultis set, setting this property to true causesCanvas.autoDrawto be set to false for the duration of the result evaluation - which is generally what you want if you're returning new components from the server.This also effects components loaded via the
RPCManager.loadScreen()API.Note : This is an advanced setting
- Parameters:
suppressAutoDraw- New suppressAutoDraw value. Default value is true- Returns:
RPCRequestinstance, for chaining setter calls
-
getSuppressAutoDraw
IfevalResultis set, setting this property to true causesCanvas.autoDrawto be set to false for the duration of the result evaluation - which is generally what you want if you're returning new components from the server.This also effects components loaded via the
RPCManager.loadScreen()API.- Returns:
- Current suppressAutoDraw value. Default value is true
-
setTimeout
Sets the timeout on this request. Default is to usedefaultTimeout.If you're using
queuing, note that the timeout setting derived from the last request in the queue is used for the entire queue. If you want to override the timeout for the queue, make sure to set your override at least on the last request in the queue.For the "xmlHttpRequest"
transport, this timeout can only happen if the server actually fails to respond within the specified number of milliseconds. For the "hiddenFrame" transport, this timeout will occur for non-200 (HTTP_OK) responses.If
timeoutis set to zero, the RPCManager will not enforce a timeout for this request. However, note that all browsers enforce their own timeouts on HTTP requests, and may have different timeouts for different kinds of failures (no response at all from server, hung response after receiving headers, hung response after receiving partial data, etc). Also, intervening web proxies or firewalls may impose timeouts of their own.As a rough rule of thumb, if your server response will have a lengthy pause before data begins to be sent, 1-2 minutes is the maximum allowable pause for a public site and still may not work for a minority of users, but up to 4 minutes may be allowable in a controlled environment (intranet or extranet with well-known user base).
Above these limits, your code should return some kind of immediate response to the browser, then kick off a server-side process to complete processing. The browser can then either poll for completion, or use a server-push notification system such as Smart GWT Real-Time Messaging (see http://smartclient.com/product).
Note : This is an advanced setting
- Parameters:
timeout- New timeout value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#defaultTimeout
-
getTimeout
Sets the timeout on this request. Default is to usedefaultTimeout.If you're using
queuing, note that the timeout setting derived from the last request in the queue is used for the entire queue. If you want to override the timeout for the queue, make sure to set your override at least on the last request in the queue.For the "xmlHttpRequest"
transport, this timeout can only happen if the server actually fails to respond within the specified number of milliseconds. For the "hiddenFrame" transport, this timeout will occur for non-200 (HTTP_OK) responses.If
timeoutis set to zero, the RPCManager will not enforce a timeout for this request. However, note that all browsers enforce their own timeouts on HTTP requests, and may have different timeouts for different kinds of failures (no response at all from server, hung response after receiving headers, hung response after receiving partial data, etc). Also, intervening web proxies or firewalls may impose timeouts of their own.As a rough rule of thumb, if your server response will have a lengthy pause before data begins to be sent, 1-2 minutes is the maximum allowable pause for a public site and still may not work for a minority of users, but up to 4 minutes may be allowable in a controlled environment (intranet or extranet with well-known user base).
Above these limits, your code should return some kind of immediate response to the browser, then kick off a server-side process to complete processing. The browser can then either poll for completion, or use a server-push notification system such as Smart GWT Real-Time Messaging (see http://smartclient.com/product).
- Returns:
- Current timeout value. Default value is null
- See Also:
-
com.smartgwt.client.rpc.RPCManager#defaultTimeout
-
setTransport
Selects the transport used for this RPCRequest. If unset, the value ofdefaultTransportwill be used.If you're using queueing, note that all requests in the queue must use the same transport. If you attempt to send a request via a different transport than those that are currently on the queue, it will be sent to the server separately, ahead of the queue, and a warning will be logged to the Developer Console.
If you specify an unknown transport, an error will be logged to the DeveloperConsole and
defaultTransportwill be used instead.If you specify the
xmlHttpRequesttransport and it is not available, a warning will be logged to the Developer Console and the RPCManager will attempt to use thehiddenFrametransport instead for this request. Note that some features likeserverOutputAsStringrequire thexmlHttpRequesttransport and will not work if thexmlHttpRequesttransport is unavailable (this can happen if the end user is using Internet Explorer and has disabled ActiveX). You can check whether or not thexmlHttpRequesttransport is currently available by callingRPCManager.xmlHttpRequestAvailable().Note : This is an advanced setting
- Parameters:
transport- New transport value. Default value is RPCManager.defaultTransport- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#defaultTransport
-
getTransport
Selects the transport used for this RPCRequest. If unset, the value ofdefaultTransportwill be used.If you're using queueing, note that all requests in the queue must use the same transport. If you attempt to send a request via a different transport than those that are currently on the queue, it will be sent to the server separately, ahead of the queue, and a warning will be logged to the Developer Console.
If you specify an unknown transport, an error will be logged to the DeveloperConsole and
defaultTransportwill be used instead.If you specify the
xmlHttpRequesttransport and it is not available, a warning will be logged to the Developer Console and the RPCManager will attempt to use thehiddenFrametransport instead for this request. Note that some features likeserverOutputAsStringrequire thexmlHttpRequesttransport and will not work if thexmlHttpRequesttransport is unavailable (this can happen if the end user is using Internet Explorer and has disabled ActiveX). You can check whether or not thexmlHttpRequesttransport is currently available by callingRPCManager.xmlHttpRequestAvailable().- Returns:
- Current transport value. Default value is RPCManager.defaultTransport
- See Also:
-
com.smartgwt.client.rpc.RPCManager#defaultTransport
-
setUseCursorTracker
If true, an image is shown to the right of the cursor whenpromptStyleis set to "cursor", otherwise the cursor itself is modified via css to the value ofpromptCursor.If left unspecified, the default value is set by
useCursorTracker.- Parameters:
useCursorTracker- New useCursorTracker value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
com.smartgwt.client.rpc.RPCManager#useCursorTrackerRpcPrompt overview and related methods
-
getUseCursorTracker
public boolean getUseCursorTracker()If true, an image is shown to the right of the cursor whenpromptStyleis set to "cursor", otherwise the cursor itself is modified via css to the value ofpromptCursor.If left unspecified, the default value is set by
useCursorTracker.- Returns:
- Current useCursorTracker value. Default value is false
- See Also:
-
com.smartgwt.client.rpc.RPCManager#useCursorTrackerRpcPrompt overview and related methods
-
setUseHttpProxy
Indicates whether this request should use the HttpProxyServlet in order to enable contacting hosts other than the origin server (available only in Pro Edition or better).When various UI components issues requests automatically, or when a call to
RPCManager.sendProxied()is made, the HttpProxy will automatically be used for a URL that starts with "http" and uses a hostname other than "localhost" orwindow.location.hostname, or if the port number differs.rpcRequest.useHttpProxyshould only be used to force requests to go through the HttpProxy when the above rules don't work, or to avoid using the HttpProxy when contacting hosts that allow cross-site calls via the Http Access Control standard.You can also set
useHttpProxy:false to avoid ever using the HttpProxyServlet.- Parameters:
useHttpProxy- New useHttpProxy value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
getUseHttpProxy
Indicates whether this request should use the HttpProxyServlet in order to enable contacting hosts other than the origin server (available only in Pro Edition or better).When various UI components issues requests automatically, or when a call to
RPCManager.sendProxied()is made, the HttpProxy will automatically be used for a URL that starts with "http" and uses a hostname other than "localhost" orwindow.location.hostname, or if the port number differs.rpcRequest.useHttpProxyshould only be used to force requests to go through the HttpProxy when the above rules don't work, or to avoid using the HttpProxy when contacting hosts that allow cross-site calls via the Http Access Control standard.You can also set
useHttpProxy:false to avoid ever using the HttpProxyServlet.- Returns:
- Current useHttpProxy value. Default value is null
-
setUseSimpleHttp
When set to true, assume the request is not going to the Smart GWT server, and hence send a simple HTTP request that does not use Smart GWT-specific request encoding.Values specified in
paramsare sent to to the server as HTTP request parameters. IfhttpMethodis "GET", parameters appear in the request URL, otherwise if httpMethod is "POST", parameters are encoded in the request body (exactly like an HTML form does). These parameters are then accessible via typical server-side APIs for retrieving HTTP parameters, eg, servletRequest.getParameter(paramName) in Java Servlets.Note that if
httpMethodmethod is POST anddatais supplied,datais assumed to be a string to post as the HTTP request body, andparamsare sent as URL parameters instead. This usage is for sending custom request bodies such as the XML payloads used for SOAP. In this case,contentTypeis typically also set to indicate the content type of the request body.Setting
useSimpleHttpto true also automatically setsserverOutputAsStringto true as well.Note : This is an advanced setting
- Parameters:
useSimpleHttp- New useSimpleHttp value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls
-
getUseSimpleHttp
When set to true, assume the request is not going to the Smart GWT server, and hence send a simple HTTP request that does not use Smart GWT-specific request encoding.Values specified in
paramsare sent to to the server as HTTP request parameters. IfhttpMethodis "GET", parameters appear in the request URL, otherwise if httpMethod is "POST", parameters are encoded in the request body (exactly like an HTML form does). These parameters are then accessible via typical server-side APIs for retrieving HTTP parameters, eg, servletRequest.getParameter(paramName) in Java Servlets.Note that if
httpMethodmethod is POST anddatais supplied,datais assumed to be a string to post as the HTTP request body, andparamsare sent as URL parameters instead. This usage is for sending custom request bodies such as the XML payloads used for SOAP. In this case,contentTypeis typically also set to indicate the content type of the request body.Setting
useSimpleHttpto true also automatically setsserverOutputAsStringto true as well.- Returns:
- Current useSimpleHttp value. Default value is false
-
setUseStrictJSON
If set true, tells the server to use strict JSON format when serializing the response data. If set false, tells the server to use a more permissive encoding that is still valid JS, but is not technically valid JSON. The default value of null tells the server to use the default global setting (see below).To enable this globally for all responses you can set
RPCManager.useStrictJSONinserver.properties. If the global flag is not set either way inserver.properties, it defaults to false.Note : This is an advanced setting
- Parameters:
useStrictJSON- New useStrictJSON value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
getUseStrictJSON
If set true, tells the server to use strict JSON format when serializing the response data. If set false, tells the server to use a more permissive encoding that is still valid JS, but is not technically valid JSON. The default value of null tells the server to use the default global setting (see below).To enable this globally for all responses you can set
RPCManager.useStrictJSONinserver.properties. If the global flag is not set either way inserver.properties, it defaults to false.- Returns:
- Current useStrictJSON value. Default value is null
- See Also:
-
setWillHandleError
With willHandleError:false, rpcResponses that indicate an error go through centralized handling in the RPCManager and rpcRequest.callback is never invoked.Setting willHandleError:true means that your rpcRequest.callback will receive rpcResponses that have an error status and must handle them.
See also the error handling section in the
RPCManagerdocs.- Parameters:
willHandleError- New willHandleError value. Default value is false- Returns:
RPCRequestinstance, for chaining setter calls- See Also:
-
getWillHandleError
With willHandleError:false, rpcResponses that indicate an error go through centralized handling in the RPCManager and rpcRequest.callback is never invoked.Setting willHandleError:true means that your rpcRequest.callback will receive rpcResponses that have an error status and must handle them.
See also the error handling section in the
RPCManagerdocs.- Returns:
- Current willHandleError value. Default value is false
- See Also:
-
setWithCredentials
In browsers that support Cross-Origin Resource Sharing and XMLHttpRequest 2, and where the service at theactionURLallows the origin to send credentials (seeAccess-Control-Allow-Credentials), should user credentials such as cookies, HTTP authentication, and client-side SSL certificates be sent with the actual CORS request?This setting only applies when the request
transportisRPCTransport.XMLHTTPREQUEST.Note that Internet Explorer 10 and 11 do not send cookies as part of user credentials: IE10 doesn't support cookies on cross origin XMLHttpRequest withCredentials=true.
Note : This is an advanced setting
- Parameters:
withCredentials- New withCredentials value. Default value is null- Returns:
RPCRequestinstance, for chaining setter calls
-
getWithCredentials
In browsers that support Cross-Origin Resource Sharing and XMLHttpRequest 2, and where the service at theactionURLallows the origin to send credentials (seeAccess-Control-Allow-Credentials), should user credentials such as cookies, HTTP authentication, and client-side SSL certificates be sent with the actual CORS request?This setting only applies when the request
transportisRPCTransport.XMLHTTPREQUEST.Note that Internet Explorer 10 and 11 do not send cookies as part of user credentials: IE10 doesn't support cookies on cross origin XMLHttpRequest withCredentials=true.
- Returns:
- Current withCredentials value. Default value is null
-
downloadCallback
public boolean downloadCallback(RPCResponse response, Map data, String fileName, String type, RPCRequest request) Callback fordownload requestswithtransportset to"xmlHttpRequest".This method will fire when a download request completes. If
DSRequest.willHandleErroris true it will fire on both successful completion or failure as reflected by theDSResponse.status.By default, successful download requests will save the returned file to the filesystem. To suppress this behavior, return false from this callback. This allows you to take some other action such as generating a data url to display media, etc.
Note that for a successful download request, the
dataparameter will be a Blob. For an unsuccessful download attempt, the data parameter typically contains the error message from the server. To invoke standard error handling,RPCManager.runDefaultErrorHandling()may be called.- Parameters:
response- the response to the requestdata- The Blob returned by the server, or error message if the download was unsuccessfulfileName- The file name for the downloaded file, derived from the content-disposition header.type- the content type for the downloaded file, as specified by the content-type header.request- the request that initiated the download- Returns:
- return false to suppress default behavior of saving the download file to the user's filesystem.
-
xhr_onProgress
Progress event notification fired repeatedly during requests withtransportset to"xmlHttpRequest".This callback will be invoked from the native XMLHttpRequest progress event.
This is typically useful to provide visual feedback to the user when a lengthy download is in progress.
- Parameters:
progressEvent- The native ProgressEvent with attributes indicating theloadedcontent so far, and, ifContent-Lengthheaders were set on the response, thetotaldownload size. Note that this is a native event produced by the browser and Smart GWT does not guarantee consistency for the event object, or the timing of theonprogressevent notifications across browsers.request- the request that initiated the download
-
setData
This attribute specifies the payload of the RPCRequest. When using theSmart GWT server, objects sent to the server asrequest.datawill be available on the server-sideRPCRequestobject as Java Objects. This is achieved by serializing the client side data in a JSON type format and generating Java Objects on the server from this serialized data.If the client side
request.datais set to a Java object in your SmartGWT code on the client side, logic in your server side code will be passed the following equivalent objects:Client Server Type boolean primitive or Boolean Boolean Non-fractional numeric value
(e.g: int, Integer, long, Long)Long Fractional numeric value
(e.g:float, Float, double, Double)Double String String Date Date List, Set, Iterator List Map Map Record Map RecordList List of Map ResultSet List of Map
(containing only loaded rows if the ResultSet has a partial cache on the client)
Note that the order of keys/values in the Maps created on the server is not guaranteed because JavaScript Object literals do not guarantee order.Server->client conversion follows this table as well, with some extras. See the toJS() method on JSTranslater in the server documentation for a description of additional behaviors.
When not communicating with the Smart GWT server,
rpcRequest.databecomes simple HTTP parameters or an HTTP request body - seeuseSimpleHttpfor details.- Parameters:
data- data Default value is null- See Also:
-
getData
Returns the payload of this request to be sent to the server, as a JavaScriptObject.When using the
Smart GWT server, objects sent to the server asrequest.datawill be available on the server-sideRPCRequestobject as Java Objects. This is achieved by serializing the client side data in a JSON type format and generating Java Objects on the server from this serialized data.If the client side
request.datais set to a Java object in your SmartGWT code on the client side, logic in your server side code will be passed the following equivalent objects:Client Server Type boolean primitive or Boolean Boolean Non-fractional numeric value
(e.g: int, Integer, long, Long)Long Fractional numeric value
(e.g:float, Float, double, Double)Double String String Date Date List, Set, Iterator List Map Map Record Map RecordList List of Map ResultSet List of Map
(containing only loaded rows if the ResultSet has a partial cache on the client)
Note that the order of keys/values in the Maps created on the server is not guaranteed because JavaScript Object literals do not guarantee order.Server->client conversion follows this table as well, with some extras. See the toJS() method on JSTranslater in the server documentation for a description of additional behaviors.
When not communicating with the Smart GWT server,
rpcRequest.databecomes simple HTTP parameters or an HTTP request body - seeuseSimpleHttpfor details. -
getDataAsString
-
isDSRequest
-