We confirmed a bug here and it's being worked on.
Announcement
Collapse
No announcement yet.
X
-
I think this is the same problem that I'm having (in another thread). I need to configure the DataSource so that the server side knows what to load.
I'm trying to pass arbitrary data into a databound object by calling setDefaultParams() on the DataSource that I'm binding to a widget.
Theoretically (if i understand this), those default parameters should show up on the server in the Request object somewhere correct?
Comment
-
I just checked with the files in 'http://www.smartclient.com/builds/smartgwt/2010-07-12/' which is where I think it should be since DataSource is part of smartgwt.jar and this does not pass parameters set with
DataSource.setDefaultParams()
I believe the bug still exists.
Can you please give an ETA on when this will be fixed? thanks
Comment
-
I managed to solve this in a not-too-inelegant manner. 'setDefaultParameters()' would still be ideal, but this works in a pinch.
I added a new Map to my DataSource (in my case the base class GenericGwtRpcListDataSource found in another thread on these forums) and I stick my DataSource configuration parameters inside.
Code:protected Map<String,String> dataSourceParameters = new HashMap<String,String>();
Code:criterias.putAll(dataSourceParameters);
Alternatively for people not using the DataSource classes above, essentially you need to make a new fetch method with extra parameters. Add your own fetch method and make one of the parameters a serialized object (Map<String,String> seems best). It will then come across the wire and be usable on the server.
Comment
-
I tried to get this out of the HTTPRequest as well. Then saw that on the server fetch(), there was actually NO params.. the paramMap was empty. Glad I checked the forums and going with work around. Now I know, when something simple dosn't seem to work check the forums and don't sweat it.
Code:HttpServletRequest request = this.getThreadLocalRequest(); Map<String, String> paramMap = request.getParameterMap(); for ( Map.Entry <String,String> entry: paramMap.entrySet()){ String key = entry.getKey(); String value = entry.getValue(); System.out.println("Entry key:value ->" + entry + " :" + value); }
Comment
-
Hi,
By doing the following in GwtRpcDataSource
Code:public GwtRpcDataSource () { setDataProtocol (DSProtocol.CLIENTCUSTOM); setDataFormat (DSDataFormat.CUSTOM); setClientOnly (false); }
Comment
-
Note post 25 - if you're using GWTRPCDataSource, SmartGWT is not forming the HttpRequest to the server and cannot supply HTTP parameters. This is one of the reasons we recommend against GWTRPCDataSource in the FAQ.
If you think this API is broken when GWTRPCDataSource is *not* being used, show a minimal, standalone test case that allows the issue to be reproduced.
Comment
Comment