Hi,
I am using SmartGWT version 3.0 and would like to send additional properties in request body paylod message sent to server in AJAX communcation, I have following scenario:
1. Create custom DataSource that extends from com.smartgwt.client.data.DataSource
and in constructor have
2. ListGrid that has set created dataSource in point 1 and has defined fetch method:
3. in transformRequest I would like to get these request properties and use it in construction of request, but there it another instance of DSRequest object that does not have properties I set up before:
myProp property and also set parms have null values there, I tried to get it in many ways but without sucess
Problem is caused by setting
, when I remove this setter, request has my parameter but with setting it to true SmartGWT creates new DSRequest instance with other properties.
Could you help me how to achieve my goal?
thanks,
Michal
I am using SmartGWT version 3.0 and would like to send additional properties in request body paylod message sent to server in AJAX communcation, I have following scenario:
1. Create custom DataSource that extends from com.smartgwt.client.data.DataSource
and in constructor have
Code:
setDataProtocol(DSProtocol.CLIENTCUSTOM); setDataFormat(DSDataFormat.CUSTOM); setClientOnly(false); setCacheAllData(true);
Code:
@Override public void fetchData(Criteria criteria, final DSCallback responseCallback, DSRequest request) { if (request == null) request = new DSRequest(); request.setAttribute("myProp", "hello"); Map<String, String> params = new HashMap<String, String>(); params.put("myProp2", "hello2"); request.setParams(params); super.fetchData(criteria, responseCallback, request); }
Code:
@Override protected Object transformRequest(DSRequest request) { String myProp = request.getAttribute("myProp"); assert myProp != null; }
Problem is caused by setting
Code:
setCacheAllData(true);
Could you help me how to achieve my goal?
thanks,
Michal
Comment