473,409 Members | 2,056 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,409 software developers and data experts.

Adding to listbox without refreshing..

JJ
I want to have two lists (may have to be listboxes) on a page that are
populated from a database.

I then need to be able to click on an entry in one box and add it to the
other, _preferably_ without refreshing the page.

Is this possible? Am I coming across another reason to venture into AJAX I
wonder....

What controls should I use for the lists to allow selection, sorting, etc
(listbox?).

Thanks in advance,

JJ
May 4 '07 #1
5 2174
On May 4, 1:28 pm, "JJ" <a...@xyz.comwrote:
I want to have two lists (may have to be listboxes) on a page that are
populated from a database.

I then need to be able to click on an entry in one box and add it to the
other, _preferably_ without refreshing the page.

Is this possible? Am I coming across another reason to venture into AJAX I
wonder....

What controls should I use for the lists to allow selection, sorting, etc
(listbox?).

Thanks in advance,

JJ
if you need just to add a new option you can easily do it using pure
JavaScript

Example: http://www.mredkj.com/tutorials/tutorial005.html

But I think you would need to save that new option on the server side
(a database). I'm right?

May 4 '07 #2
Hello JJ,

Just to add to Alexey's post:

There are 2 possible solutions:
1) select everything for 2 listboxes at once, send all data to your JS as
2 arrays - one for the first listbox and second is the all values for your
selection in first listbox

2) Making async XmlHttpRequest, pumping the required info for the second
listbox. See intro for XHR there http://www.codeproject.com/Ajax/AjaxExplained.asp

If the set of values is small the first case is preferable

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

JI want to have two lists (may have to be listboxes) on a page that
Jare populated from a database.
J>
JI then need to be able to click on an entry in one box and add it to
Jthe other, _preferably_ without refreshing the page.
J>
JIs this possible? Am I coming across another reason to venture into
JAJAX I wonder....
J>
JWhat controls should I use for the lists to allow selection, sorting,
Jetc (listbox?).
J>
JThanks in advance,
J>
JJJ
J>
May 4 '07 #3
JJ
Yes - its a case of adding a load of entries, then doing the database update
(I hope).
I'm trying to save on repeat database calls (for each entry added), and also
on page refreshes for each addition (but maybe this can't be avoided).

Perhaps its possible to select several entries in the one listbox, then
click submit to add them in one refresh...?

JJ

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
On May 4, 1:28 pm, "JJ" <a...@xyz.comwrote:
>I want to have two lists (may have to be listboxes) on a page that are
populated from a database.

I then need to be able to click on an entry in one box and add it to the
other, _preferably_ without refreshing the page.

Is this possible? Am I coming across another reason to venture into AJAX
I
wonder....

What controls should I use for the lists to allow selection, sorting, etc
(listbox?).

Thanks in advance,

JJ

if you need just to add a new option you can easily do it using pure
JavaScript

Example: http://www.mredkj.com/tutorials/tutorial005.html

But I think you would need to save that new option on the server side
(a database). I'm right?

May 4 '07 #4
On May 4, 2:08 pm, "JJ" <a...@xyz.comwrote:
Yes - its a case of adding a load of entries, then doing the database update
(I hope).
I'm trying to save on repeat database calls (for each entry added), and also
on page refreshes for each addition (but maybe this can't be avoided).

Perhaps its possible to select several entries in the one listbox, then
click submit to add them in one refresh...?

JJ

"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message

news:11**********************@y80g2000hsf.googlegr oups.com...
On May 4, 1:28 pm, "JJ" <a...@xyz.comwrote:
I want to have two lists (may have to be listboxes) on a page that are
populated from a database.
I then need to be able to click on an entry in one box and add it to the
other, _preferably_ without refreshing the page.
Is this possible? Am I coming across another reason to venture into AJAX
I
wonder....
What controls should I use for the lists to allow selection, sorting, etc
(listbox?).
Thanks in advance,
JJ
if you need just to add a new option you can easily do it using pure
JavaScript
Example:http://www.mredkj.com/tutorials/tutorial005.html
But I think you would need to save that new option on the server side
(a database). I'm right?- Hide quoted text -

- Show quoted text -
You can put a hidden field and populate it with the added items.

BTW, I found an interesting control, that might have what you need

Take a look at http://metabuilders.com/Tools/DualList.aspx

May 4 '07 #5
JJ
Thanks will take a look.
JJ
You can put a hidden field and populate it with the added items.

BTW, I found an interesting control, that might have what you need

Take a look at http://metabuilders.com/Tools/DualList.aspx

May 4 '07 #6

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

Similar topics

8
by: Bill | last post by:
I'm trying to create a wizardlike interface using a couple listboxes. I know you've seen it before. You double click on an item in one listbox and it "moves" it to the other. I used to approach...
1
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various...
4
by: N. Graves | last post by:
Hello... thank you for your time. I have a form that has a List box of equipotent records and a sub form that will show the data of the equipment select from the list box. Is it possible to...
3
by: jayderk | last post by:
Hello All, I am running in to a situation where the listbox is not refreshing for me. I am using a timer to cycle every second and call the timer_elapsed() event. in the time_elapsed event...
0
by: Dave | last post by:
Hi all, I have a listbox that is complex bound by an arraylist. The problem is that when I delete an object from the arraylist, the listbox does not reflect those changes. I tried refreshing...
0
by: Tony Botelho | last post by:
I am fairly new to VB.NET and I am having some difficulty working with a bound listbox. On a simple form, I open a connection to my database and load a dataser. I then bind a listbox to the the...
1
by: erin.sebastian | last post by:
Hello Everyone, I have created a small application in vb.net to maintain items in a database the problem i am having is that once i delete/add/edit an individual item the changes don't reflect in...
1
by: sweetiecakes | last post by:
Hi I have a ListBox which is binded to a dataSet. When I need to refresh this dataSet, it works, but the old entries don't get removed from the listbox. Items.Clear() doesn't work when a...
45
by: angelicdevil | last post by:
i have 2 tables 1 is status_type with field name status and other is users with field username and status now i want that the first listbox lists all status from status type ( this i have achieved...
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: 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
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
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,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.