Solved

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

Posted on 2006-11-12
7
252 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
doubleChar java challenge 7 102
maven set up 2 126
countXY challenge 28 144
how to hide hide popup page refresh second time? 10 109
Facing problems with you memory card? Cannot access your memory card? All stored data, images, videos are lost? If these are your questions...than this small article might help you out in retrieving your lost or inaccessible data.
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

12 Experts available now in Live!

Get 1:1 Help Now