Solved

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

Posted on 2006-11-12
7
250 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
Comment Utility
>>- 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
Comment Utility
-> 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
Comment Utility
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
Comment Utility
-> jaggernat: Ok, I thought maybe that JSP in itself provided this functionality.
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
i dont think it does
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
html form inside div 3 86
password protect pdf 11 72
iterator example remove 8 74
if statement not resolving in my code 5 41
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now