-
30 Mar 2012 6:05 AM #1
Record edited by 3 forms (in three tabs) and sent back to DB
Record edited by 3 forms (in three tabs) and sent back to DB
Hi!
In a MVC Architecture, I have a view which is basically a window with three tabs in it. This view (an "edit record" view) is called by a click on a grid cell on my main page. What I would like to do is to edit the record of my grid in my window/view. This technique is well described in the MVC Architecture guide. My problem is that I would like to edit (virtually, to "spread") my record in the three forms of the three tabs in my Window. For example:
record (from grid in my main page): username, address, zipcode, phone, fax, ...
Tab1/Form1
edit: username and address
Tab2/Form2
edit: zipcode
Tab3/Form3
edit: phone and fax
And then, after the record is edited, I would like to update it and send it to my database.
What is the simplest way to achieve this?
Thank you very much in advance.
Davide
-
30 Mar 2012 9:28 AM #2
You should put teh tabs INSIDE just one form and POST to your server code using form.getForm().submit().
Another way is, allways putting all tabs inside one form, move from input components to model instance with form.getForm().updateRecord(modelInstance) then send using model's proxy or store's proxy.
Look API docs for Ext.form.Panel, Proxy and Store.
Regards.UI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!
-
31 Mar 2012 11:32 PM #3
Thank you very much! It worked like a charm.
Davide


Reply With Quote