Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to extract DefaultParams from the Datasource in transformResponse method

    SmartGWT 6.1 Version

    Hi,
    I have a scenario where there are calls originating from Client in multiple places and have written abstract class which catch all the responses coming from server in a single place where the method transformResponse is overriden.

    Now i want to extract the defaultParams in transformResponse Method which is set before firing request.

    Note: i tried this way
    DataSource dataSource = TypeDataSourceBase.get(request.getDataSource());
    Map<String, String> hMap=dataSource.getDefaultParams();

    In case of multiple request fires from client with same request datasource with different input params, it is giving me only the last call defaultparams for the request(request.getDataSource().
    Last edited by sameen; 7 Mar 2018, 09:22.

    #2
    Evidently you are changing defaultParams on a per-request basis? That's invalid, and also obviously a call to getDefaultParams() cannot return anything but the most recent params since you do not pass a request.

    Instead of updating defaultParams before each request, if you need to provide different params for each request, do that in transformRequest. If you then need to store those params for later access, you can store them as a custom property on the DSRequest via setAttribute().

    Comment

    Working...
    X