Hi All,
Has any person tried to use the clientcustom before? Any simple template?
If not, then is this the right way to go .. ?
1- I have the xml created on the application server where it is transformed to javascript using fromXML method.
2- Set the datasource on the xml to “clientcustom” on the dataProtocol
3- Translating the source to JS on the client side
4- Extending the DataSource object (CustomDS) then override transformRequest and processResponse methods.. Will calling CustomDS.fromXML() returns my customDS object?
You seem to have conflated several different concepts..
clientCustom is for a DataSource that is going to use a non-SmartClient transport, eg, it’s not going to use simple HTTP requests and is not talking to the SmartClient Server.
fromXML() is for creating DataSources dynamically that talk to the SmartClient server.
These don’t make sense together. What exactly do you want to achieve? Be detailed.
Hmm. Ok, sorry for the confusion as I am still learning!
I have created objects on the server that are bound to the user http session. These objects are collection of sets and records which accept add, update, delete and insert operations and provide array lists of maps when a fetch is called on the set. Data sources are created as xml files on the server and passed on the client when user loads the page using JSTranlator and fromXML method to create that datasource then translate it to client.
I have also created Grid lists on that page (pages are sent via servlets) using these created data sources on the page. My goal is to make these grid lists communicate with the servlet to send and accept operations. I saw that sticky thread (Custom rpc operations) on GWT and that was very close on what I wanted to do.
Unless you’ve done something to prevent it, the grids that are bound to the DataSource you generated will send “add” and “update” requests to the server automatically if you enable inline editing. You can see SmartClient’s attempt to process these in the server-side log.
You can use DMI to send these requests to Java methods on your choice.
Ok. Understood. and in this case, I won’t be using datasource on the server side to execute it and get the response.. I will be building the response based on the persistance layer I have. For example, I will create a response and sets its data based on the operation type received on the sever?
Also, in this example,
isc.RPCManager.actionURL = “dynamicDataSource.jsp”;
would be applied to all datasources and all of their operations?
Yes, that’s right.
Note that your fromXML() call creates a DataSource on the server, which is capable of performing server-side validation for you (just call validate()). That’s one of the primary purposes of using fromXML().
ammours, stop posting in the GWTRPC thread, your question does not make sense there, it was already deleted once and marked off topic.