Interface ICrossViewScopeResponseSupplier<T extends Serializable>
-
- Type Parameters:
T
- Type of the requested data.
- All Superinterfaces:
Serializable
public interface ICrossViewScopeResponseSupplier<T extends Serializable> extends Serializable
Creates the response to a cross scope request. This supplier is called within the view scope of the target.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
computeRequestedData(IComputeRequestedDataParams params)
default String
getClientDataProvider()
-
-
-
Method Detail
-
computeRequestedData
T computeRequestedData(IComputeRequestedDataParams params) throws Exception
- Parameters:
params
- Parameters for computing the requested data. When agetClientDataProvider()
was specified, the data returned by the callback can be accessed viaIComputeRequestedDataParams.getClientData()
.- Returns:
- The result that should be returned in response to the request.
- Throws:
Exception
- When the result could not be created.
-
getClientDataProvider
default String getClientDataProvider()
- Returns:
- Optional callback on the client (browser). Must be a JavaScript expression that evaluates to a function.
When given, this callback is invoked on the client without arguments in the view scope of the request target.
The callback may return a JSON object (or a Promise for a JSON object), which can then be accessed in
computeRequestedData(IComputeRequestedDataParams)
viaIComputeRequestedDataParams.getClientData()
. This lets you send data to the client and/or retrieve data from the client if necessary.
-
-