PDA

View Full Version : ExtJs on a multipage app?



bjan
17 Apr 2013, 6:12 AM
Hi everybody,

I'm currently working on a quite large project on which the UI is made with ExtJs. As this is a Java web application, we chose to use well-known tools, and views are done in JSPs. Our app consists of lots of screens to CRUD various kind of objects. The pattern is always the same:

- show a page with a list of objects of a given type (in a GridPanel)
- allow filtering the displayed listed using a filter form
- for each object in the list, add buttons to view or modify the object, which redirect to other views

Each view is in a separate JSP, but I'm getting the feeling that it does not correspond to the 'single page application' approach in ExtJS:

- every JSP reloads ext-all.js, which is time consuming (Chrome reports more than 1s just to parse the JS file)
- we have more and more JS code which is very similar between pages (duplicated code)
- we can't easily use Sencha cmd to build our own app-all.js since we have too much JSPs to configure (about 50 and growing)

We are using ExtJS more as a nice UI components library rather than as a full MVC application framework, which may be the problem.

I read a lot of similar questions (on StackOverflow and here), and every time people tend to suggest that ExtJS should be loaded once and for all, and communication with the server should be reduced to XML or JSON exchanges. Could someone confirm this?

If I make a single page application with dozens of different forms, will this impact the app's performance?

Thanks for your advice
Bastien

slemmon
18 Apr 2013, 8:29 PM
While I would say the prevailing convention is to have all views served up and managed on a single page, multi-page is also an option.

By chance have you seen the guid on building a Multi-page ExtJS app? It might answer a few of the questions you have about how to share/manage code across multiple pages.
http://docs.sencha.com/extjs/4.2.0/#!/guide/command_app_multi