title: SmartGWT DataSource binding to ListGrid and DynamicForm
body: <p>First let me warn readers not to pass me off to any links in isomorphic because it is highly probable I have read it and I have scoured the smartgwt showcase running locally here as I ask this question. What I ask is not documented and if it is, I am unable to decipher and need actual explanation here. No, do not tell me about SmartGWT EE. This case is purely Smartclient interacting with my JSP (or perl, php) on the server side, which I use to interact with a SAS backend.</p>
  
  <p>This question has nothing to do with how to operate SAS. I am mentioning SAS to illustrate the point that smartclient has to interact with SAS web service directly and not through SmartGWT server. I asked a similar but different question at smartclient forum which is still unanswered, so this must be a very difficult subject that probably even people at isomorphic does not have an answer.</p>
  
  <p>I have</p>
  
  <ul>
  <li>JSON xjsondatasource url produced from a SAS web service, sasxjsondsrc. I am mocking it with a JSP on Jetty.</li>
  <li>sasxjsondsrc = id(primaryKey), name, description.</li>
  <li>ListGrid whose datasrc is set to sasxjsondsrc.</li>
  <li>SearchForm/DynamicForm editForm whose datasrc is set to sasxjsondsrc.</li>
  </ul>
  
  <p>I need to</p>
  
  <ul>
  <li>user would visually select a row on listGrid and then click del button, which my code would trigger listGrid.removeSelectedData(), which would then remove only that row locally and as well as send to sasxjsondsrc url the parameters id=id to be deleted, operation=DEL.</li>
  <li>user would visually select a row on listGrid and then click modify button, which my code would editForm.editSelectedData(). When user presses save edit button, my code would trigger editForm.saveData(), which would then modify that row locally and as well as send to sasxjsondsrc url the parameters id=id, name=modified-value, description=modified-description, operation=MOD.</li>
  <li>user would click add button and my code would trigger editForm.saveData(), which would then append that row locally and as well as send to sasxjsondsrc url the parameters name=new-name, description=new-description, operation=ADD.</li>
  </ul>
  
  <p>This local-server management is what smartclient advertises itself as an advantage. The problems are</p>
  
  <ol>
  <li>my JSP is not registering smartclient sending any parameter to indicate what operation should be performed. It is only receiving the datasource fields=values as parameters for the affected records.</li>
  <li>the records are not appended or modified locally for add or edit operations.</li>
  <li>to overcome problem (1), I tried providing an extra non-displayed datasource field called operation. But when a dynamic form is bound to that datasource, the dynamicform field would not allow me to programmatically modify the operation field successfully.</li>
  <li>I tried appending operation as a DSRequest but my JSP is not receiving it either.</li>
  </ol>
  
  <p><strong>HOW does my JSP know what operation (ADD/REMOVE/EDIT) is being performed?</strong></p>
  
  <p>OK, to cut a long story short - datasource in SmartGWT is a horribly tricky business. I have been advised to use SmartGWT only for its UI but I should avoid using SmartGWT datasource because it is too tricky to deal with. Could some post or link me to examples of how you did your SmartGWT client programming in a configuration similar to mine.</p>
  
  <p>Should I revert to using GWT 2.1M3 cell/page architecture and write my own rpc-table cells-form linking?</p>