Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-11-12
7
Medium Priority
?
262 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
5 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 450 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
In this article, the configuration steps in Zabbix to monitor devices via SNMP will be discussed with some real examples on Cisco Router/Switch, Catalyst Switch, NAS Synology device.
Loops Section Overview
Screencast - Getting to Know the Pipeline
Suggested Courses

772 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