473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

A frustrating problem. Help greatly appreciated! :-(

Hi,

I'm hoping someone can help me witht he following problem:

I have a fairly simple page that has a sort form and a button for adding the
forms details to an arraylist.

When the button is pressed, the information from the form needs to be added
to a list in the bottom half of the page.

The problem I am having is to do with persisting the array and displaying
the list.

When the button is pressed I am adding the information to the array and
adding the array to the Session.

In page load, I am reading from the session and displaying the info in the
array.

The problem is, the pageload event happens BEFORE the button click event, so
the new data isn't added to the array until after page load has run. Which
is rubbish!

Does anyone know how I can fix this or do it in a different way to get the
right result?

Thanks to anyone who can help

Kindest Regards

Simon
Nov 18 '05 #1
1 852
What you probably want to do is something like this

function DisplayListAtBottomofPage()
{
... code to display list a tbottom of page goes here from the session
variable
}

Page_Load (...)
{
if (IsPostBack==false) { DisplayListATBottomOfPage(); } // this only
fires if we are not postingback aka a button was not pressed
}
Button1_ServerClick(..._)
{
// Add Item to array
// Save Array in the Session
DisplayListAtBottomOfPage();

}


Hope this helps. Posting is provided as is

"Simon Harvey" <si**********@the-web-works.co.uk> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm hoping someone can help me witht he following problem:

I have a fairly simple page that has a sort form and a button for adding
the
forms details to an arraylist.

When the button is pressed, the information from the form needs to be
added
to a list in the bottom half of the page.

The problem I am having is to do with persisting the array and displaying
the list.

When the button is pressed I am adding the information to the array and
adding the array to the Session.

In page load, I am reading from the session and displaying the info in the
array.

The problem is, the pageload event happens BEFORE the button click event,
so
the new data isn't added to the array until after page load has run. Which
is rubbish!

Does anyone know how I can fix this or do it in a different way to get the
right result?

Thanks to anyone who can help

Kindest Regards

Simon

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Shaun Fleming | last post by:
I've been trying to make this simple script compatible across various browsers. It works for IE 6.0 and NS 7 but doesnt work with Opera (I have version 7.11). This is what is supposed to happen:...
5
by: Henry Jordon | last post by:
ok I have my problem entering in an expression in infix notation and it outputs the postfix notation. I now need to evaluate the postfix notation. I have some code written and there are comments as...
2
by: Paul T. RONG | last post by:
Hi, It is very strange. The mde works very well in Access XP but will get "Module not found" error when closing a form in Access 2k. I tried from yesterday evening to solve this prolem but in...
0
by: Rob Levine | last post by:
(This post also available at http://roblevine.blogspot.com/2004/11/frustrating-http-connection-behaviour.html in a slightly more readable format!) Hi All, I seem to be having a bit of a...
1
by: Simon Harvey | last post by:
Hi, I'm hoping someone can help me witht he following problem: I have a fairly simple page that has a sort form and a button for adding the forms details to an arraylist. When the button is...
0
by: deacon57 | last post by:
FYI - If you are a computer scientist (or geek), this post may be for you. I wanted to log any search keywords, etc that are used on my site. I created a simple program that logs search terms...
12
by: NOO Recursion | last post by:
Hi everyone! I am trying to write a program that will search a 12x12 for a thing called a "blob". A blob in the grid is made up of asterisks. A blob contains at least one asterisk. If an...
3
by: IamtheEvster | last post by:
Hi there, I'm using fopen for the first time and I know I'm running into a permissions problem, but I can't seem to resolve it and any help would be greatly appreciated. I'm running PHP5 and...
2
by: wishbone34 | last post by:
Hi, here is some of my code public class ControlIL extends JFrame implements ActionListener, ListSelectionListener { private JList Items; //builds the UI public ControlIL(){ ...
3
by: JFKJr | last post by:
Hello everyone, I have been trying to solve this problem from past two days. I am working for my project and stuck with this problem. Please help me out, your help will be greatly appreciated....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.