473,395 Members | 1,418 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,395 software developers and data experts.

moving items between list boxes

Kay
Hello,

I have two list boxes on my form, one initially displays blank, and through
javascript it is possible to move items from one box to another, this works
fine, I followed an article titled "How to move items between Lists with
Javascript" http://www.devx.com/GetHelpOn/10MinuteSolution/16372. My problem
is that I also have a dropdown list on the page with autopost back = true,
and a procedure to handle the text changed event of the dropdown list; my
problem is as follows: when the user selects an option in the dropdown list
the form is posted back to the server and certain other processing happens,
then when the form redisplays, the items that had been moved between the
list boxes have disappeared. How do I maintain the listboxes on a redisplay?
I need to do an autopostback on the dropdown list. I also have a save button
on the form and I know when the user clicks this, I can retrieve the value
in the listbox by doing a Request.Form("listboxID") on the server, however
the dropdownlist text changed event will occur before the save button is
clicked.

Any idea how I might preserve the users selection in the listboxes when I
present the screen back to them after the drop down list text changed event?

Any help appreciated.
Thanks,
Kay.
Nov 18 '05 #1
3 6244

In this case, because you are doing the manipulation at client side, view state is not updated on page reload and data is being lost from the listbox.

As a solution, you can either execute dual list transfer at server ...but the drawback is that for every element transfer..it will tax a trip to the server.

Another solution (which I've implemented for myself) is make a Dual list Server control and manage the view state for listboxes in the server control itself ...This way you can use the same dual listbox control more then once on the same page...

Hope this gives you direction towards the desired solution....

Regards
Avneesh
Nov 18 '05 #2
Kay
Hello Avneesh,

Thanks for your suggestion, however I am not exactly sure what you mean when
you say a "Dual list Server control", could you tell me what this means ?

Thanks,
Kay.

"Avneesh" <av*****@helloprojects.com> wrote in message
news:2B**********************************@microsof t.com...

In this case, because you are doing the manipulation at client side, view state is not updated on page reload and data is being lost from the listbox.
As a solution, you can either execute dual list transfer at server ...but the drawback is that for every element transfer..it will tax a trip to the
server.
Another solution (which I've implemented for myself) is make a Dual list Server control and manage the view state for listboxes in the server control
itself ...This way you can use the same dual listbox control more then once
on the same page...
Hope this gives you direction towards the desired solution....

Regards
Avneesh

Nov 18 '05 #3
Hi Kay.

By saying "Dual list Server control" , I ment two listbox controls togather, used to transfer values from left one to right one and vise versa.
Actually the Custom control with this feature is called "Dual listbox Server control

Hope it's clear.

Regard
Avnees

Nov 18 '05 #4

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

Similar topics

3
by: james.dixon | last post by:
Hi I was wondering if anyone else had had this problem before (can't find anything on the web about it). I have three select elements (list boxes - from here on I'll refer to them as 'the...
12
by: Kevin Blount | last post by:
I'm playing with dragable <DIV>s, being inspired by google.com/ig, where you can move items on the page around and have items you move over change position if necessary. I have 3 div's setup,...
5
by: Kay | last post by:
Hello, I have two list boxes on my form, one initially displays with items and the other displays blank, by clicking a button, it is possible to move items from one box to another and vice a...
1
by: OwlHoot | last post by:
I am using Thomas Fuchs's amazing drag-and-drop JavaScript library available at: http://wiki.script.aculo.us/scriptaculous/show/DragAndDrop to allow the user to select a subset of items listed...
0
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
0
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
3
by: e | last post by:
I have a form which includes a list box populated with items from a query. When a user double clicks on a row in the list box, each column item is put into a specific text box. The problem...
1
by: =?Utf-8?B?UGF1bA==?= | last post by:
I have two list boxes and am able to have the user move items back and fourth between them without post back but when the save button is selected (that saves data to the dbase from the list box) it...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.