[coldbox-3.1.0] - Move from using frames possibly using coldbox view caching

Warning… slightly longer than usual question ahead!

Currently we have a design layout as below.

http://wicket.apache.org/guide/img/layout.png

To improve our user experience we have set the content area to be an IFRAME in which various pages can be loaded.

This way our head, menu and footer sections are not reloaded on each page request giving a static feel to our site.

However we would like to move to layouts within Coldbox and remove the IFRAME, so the content area would become a DIV in which we would load our main content pages (which would now have all their HEAD information such as styles and global Javascript dependencies removed…Great!!)
Unfortunately this causes us a dilemma when we are submitting forms in the content DIV this will naturally submit a completely new request.
We want the user to “feel” as if their header,left and footer sections are static.

We have two different proposed solutions to solve this problem.

  1. Any page that submits within the content area uses AJAX to process the form data and then we load any resultant messages/output into the content area again using Javascript/AJAX.
  2. We somehow use the caching abilities of Coldbox to cache the Header, Menu and footer sections so that the reload times are almost non existant.

The second option is more desirable since moving towards AJAX would in theory complicate our codebase and increase development times.
However there is an additional problem… the left hand menu has a accordion nature and main menu sections can be expanded to reveal sub sections.
So if the user selects “main section 2” and the section 2 items are revealed … on sending a new request this “menu state” needs to persist.

Any thoughts suggestions on how we would achieve our desired functionality within Coldbox would be very much appreciated.

Thanks very much

Alex

use the no layout option for returning a view.

Hang on a minute, when you say forms, why don’t use use Ajax on forms as well?

Thanks Andrew AJAX is probably our best option.

I unfortunately have little experience currently using AJAX for form submission.

Just thought that having each form submit/event call build up the layout again from scratch is the more desirable option.
Was concerned that having all our forms and page links loading directly into a static content DIV instead of having each request independently build up the entire layout would have drawbacks.

But I assume you think this is not the case.

Thanks

Ajax is no different when used to submit forms, the added bonus is you can do more like client side validation better, as well as other things.

Yeah, the problem with building up the layout each time is that you then have to create more code, as you are seeing with your menu. If you write a handler for form submission and make it general it helps that. But my attitude is, why rebuild anything that doesn’t need to be. With that in mind we spend a lot of time waiting for content that we already have, for what reason? Mainly because people are lazy and think loading a whole page each and every time is easier. Note I am guilty of that as time and money dictates these decisions.

But yeah like with any Ajax calls, you return just the view and set that into the div you want to change and you don’t need to write code to remember where you where in the menu system.

Thanks Andrew!!!

We shall go for it!

:slight_smile: