Solved

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

Posted on 2006-11-12
7
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This article outlines the struggles that Macs encounter in Windows-dominated workplace environments – and what Mac users can do to improve their network connectivity and remain productive.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 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