Home » Documentation > Introduction » Embedding an Appliciation vs. a View

Embedding an Appliciation vs. a View

Whether to embed one or more views from a WebApp into a WordPress site, or to embed an entire WebApp instead (or even as well as), is an issue which deserves consideration.  There are arguments for using either approach and you should choose the one which best suits your requirements.

Embedding DataFlex views on pages in a WordPress site is a good way to add a limited amount of specific functionality to a site.  You can have a page for each view, which you can then place in the WordPress menu system which will be familiar to WordPress users and easily understandable for new visitors.

However with this approach, each view will, in effect, become its own “Single Page Application“.  When navigated away from, it will lose all state, so, for instance, if a user were to be updating their customer records, but was interrupted by the need to put a new order on the system, on returning to the customer view, any data there would have been lost.  (The user could, of course, open the Orders view page in a new browser tab or window, working around such an issue.)

Embedding an entire application would solve that state problem, as well as providing very fast and efficient switching between views, but at the price of introducing another menu on top of WordPress’s own menu system.

If a significant amount of functionality is required to be embedded in a WordPress site, embedding an entire application may prove a better approach, requiring only a single WordPress page, rather than cluttering the WordPress menus with a large number of “view pages”.