When you scaffold an MVC web application using the Scaffold Unisys Controller for ePortal Data Source with Views Dialog or the Scaffold Unisys View Dialog, you can select either of the following architectures for your application.
Traditional MVC Web Application
With an ePortal Traditional MVC web application, each client message in the data source results in a separate view (.cshtml) file. When the application is run, each view results in a complete new web page that is loaded into the web browser. As each page is submitted, an entirely new page is fetched into the browser.
This is the typical way that most web sites are structured and is appropriate for most web applications. This is the default architecture selected when you scaffold your application.
Single Page Application MVC Web Application
With an ePortal Single Page Application MVC web application, each client message in the data source also results in a separate view (.cshtml) file. When the application is run, an index page loads. As the user navigates through the application, the index page is not reloaded; instead, AJAX is used to fetch the HTML for the next view. The fetched HTML is inserted into the existing index page without reloading the entire page.
This approach has the following advantages:
Since the entire page is not reloaded as the user navigates through the application, performance may be better, especially on mobile devices. In particular, every page of an MVC application typically includes the same resource files, such as JavaScript and CSS files. Since the page is not reloaded, these resource files do not need to be downloaded again as the user navigates through the application. However, most browsers cache resource files after the first download, so the performance improvement may be minimal.
The appearance of the application may be more fluid. When an entirely new page is loaded into the browser, this typically results in a more noticeable refresh of the entire screen.
The ePortal Single Page Application MVC web application can be accessed from a Multi-Device Hybrid App. This allows you to leverage features that exist on a mobile device, such as using the mobile device camera as a barcode reader, in your MVC application. For more information, refer to ???.
To generate views that use the ePortal Single Page Application architecture, do the following:
On the Scaffold Unisys Controller for ePortal Data Source with Views Dialog, select the option Generate Web Application as a Single Page Application (AJAX).
On the Scaffold Unisys View Dialog, select the option Create View for Single Page Application (AJAX).
Notes:
AJAX was originally an acronym for Asynchronous JavaScript and XML. However, the term has evolved, and is now used in any case where JavaScript is used to dynamically load content, even if that content is not XML.
The ePortal implementation of a Single Page Application for MVC is different from other implementations of the Single Page Application architecture. The ePortal implementation dynamically loads HTML from the server and inserts that HTML into the existing page. Other implementations dynamically load JSON and process that JSON in the browser using JavaScript to dynamically generate the new HTML. In other words, the ePortal implementation uses server-side generation of HTML, whereas other implementations often use client-side generation of HTML.
Other implementations of Single Page Application architecture (such as the Microsoft implementation that uses Web API) are currently not compatible with ePortal data sources.