Note that there are some explanatory texts on larger screens.

plurals
  1. POEXT JS: is it possible to add url to reader and writer in proxy
    primarykey
    data
    text
    <p>I am creating a simple project that uses Spring 3, EXTJS 4, hibernate 3 and i want to create an ext form that pulls data from a database and you can add, remove and update this information. I have the form bring populated and now i am trying to figure out how to update a customer in the form.</p> <p>What is the best way to do this? what i was thinking of doing is using a different url for the writer than the reader so that it can pass a customer object back to my java classes to update the database</p> <p>This is the way i currently have the form being populated</p> <pre><code>Ext.onReady(function(){ var store = Ext.create('Ext.data.Store', { autoLoad: true, autoSync: true, model: 'Person', proxy: { type: 'rest', url: 'http://localhost:8080/helloworld/service/web', reader: { type: 'json' }, writer: { type: 'json', } }, ..... </code></pre> <p>and i was wondering would it be possible to use different urls for the reader and writer like so</p> <pre><code>Ext.onReady(function(){ var store = Ext.create('Ext.data.Store', { autoLoad: true, autoSync: true, model: 'Person', proxy: { type: 'rest', reader: { type: 'json', url: 'http://localhost:8080/helloworld/service/web' }, writer: { type: 'json', url: 'http://localhost:8080/helloworld/service/web/update' } }, ...... </code></pre> <p>these are the methods that i am using to populate the form and update the customer</p> <pre><code>@Controller @RequestMapping("/web") public class Web { @Autowired private CustomerService customerService; @RequestMapping(method=RequestMethod.GET) public @ResponseBody List&lt;Customer&gt; getCustomers() { List&lt;Customer&gt; list = customerService.returnAllCustomers(); return list; } @RequestMapping(value="/update", method=RequestMethod.GET) public @ResponseBody void updateCustomers(Customer customer) { customerService.saveCustomer(customer); } ...... </code></pre> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload