Solved

Designing a "menu-content"-page in ONE page

Posted on 2006-11-12
7
255 Views
Last Modified: 2010-04-01
Hi!

I am designing a classic "menu-content"-page with the menu located at left and the content located at right. The menu consists of a simple select-box inside a form, and the option values in the select-box are created from a database when the page is loaded. When the user selects an option and submits the form the content is then created from another database using the selected option as input to a SQL-where statement. The application consists of two frames menu.jsp and content.jsp. All this works fine.

From a design-perspective however frames should be avoided and instead the menu and the content should be in the same page using CSS to place each block.

Trying to establish this design in ONE page I have some questions:
- how can I ensure that the menu-part is invoked only when the form is submitted and not if the user clicks on e.g. a link in the content-page? (in the frame-design control is directed to the content.jsp-page when the form is submitted in the menu.jsp-page)
- how can I ensure that establishing the connection to the database is carried out only once when the page is loaded (and the connection should stay open when the page is used) and that the connection is closed when the page is closed?

Regards,
Jesper
0
Comment
Question by:jespersahner
  • 3
  • 2
7 Comments
 
LVL 10

Expert Comment

by:jaggernat
ID: 17927544
>>- how can I ensure that the menu-part is invoked only when the form is submitted and not if the user clicks on e.g. a link in the content-page? (in the frame-design control is directed to the content.jsp-page when the form is submitted in the menu.jsp-page)

since you are submitting the form in both cases,  you have to make sure that all the butons and links are mapped correctly.

>>>how can I ensure that establishing the connection to the database is carried out only once when the page is loaded (and the connection should stay open when the page is used) and that the connection is closed when the page is closed?

i dont think you can do that!
0
 

Author Comment

by:jespersahner
ID: 17927707
-> jaggernat: Creating the select-box should only be carried out once, i.e. when the page is loaded. How can this be done?
0
 
LVL 10

Accepted Solution

by:
jaggernat earned 150 total points
ID: 17927728
you can use javascript
something like

function createSelectBox()
{
//have the code to put fields in the select box and call this function createSelectBox()  below when page loads.
}

<BODY onLoad="createSelectBox()">

0
 

Author Comment

by:jespersahner
ID: 17928575
-> jaggernat: Ok, I thought maybe that JSP in itself provided this functionality.
0
 
LVL 10

Expert Comment

by:jaggernat
ID: 17931687
i dont think it does
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
February 24, 2017 — On February 23, Travis Ormandy, a vulnerability researcher at Google, reported on Twitter (https://twitter.com/taviso/status/834900838837411840) that massive stores of data have been leaked by CloudFlare, a company that provide…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question