Help - Search - Members - Calendar
Full Version: OT! Sorry to clog this board. Dot Net question
914World.com > The 914 Forums > 914World Garage
Qarl
First, my apologies for clogging the 914club forum with this. However, there are enough programming geeks here to usually solve my problems.

Here is what I need help with.

I have been having someone design a web-application for me.

The web application is designed using Microsoft .net framework 1.1.

It has a Microsoft SQL back end and requires Internet Explorer (due to some of the Active X controls)

Part of my application involves choosing data from drop-down lists that contain hundreds of numerical codes.

Does anyone know if tjere is a way to make the drop down lists "smart" using dot net and the web browser? Whereby you can begin typing the first few characters of the data you want from the drop down list and the drop down list automatically takes you to the code in the list that matches. I believe it's called "smart find"

Microsoft Access does this with their drop down lists.

Right now, I believe that .net and Internet Explorer are intelligent only for the first character. (i..e, it matches only the first character).

If you know a .net website that I can demonstrate this, or know of the code to implement this, please let me know.

I would be most grateful.

Regards,

Karl

lapuwali
The traditional way to do this is with Javascript aka ECMAscript, and it's perfectly doable with any programming environment, as Javascript is easy to generate. However, if they're using ActiveX controls, you can do this kind of thing with ActiveX, too. Me, I'd insist on NOT using ActiveX, but using Javascript instead, as that as a better potential for being browser neutral. IE is losing market share to Firefox...

If this is strictly an "in-house" kind of application, then requiring IE is no big deal. If this is going to be a big public website, however, I'd ditch ActiveX. Not only is it IE specific, but it's highly prone to security problems.
Rand
That would be a client-side function run at the browser end. Typically that would be done with Javascript, but since you are already limited to IE it could be done with VBScript. Here is an example:
type-ahead demo

edit... oops, James beat me to it. laugh.gif
SirAndy
QUOTE(Rand @ Apr 24 2006, 02:58 PM) *

That would be a client-side function run at the browser end. Typically that would be done with Javascript, but since you are already limited to IE it could be done with VBScript. Here is an example:
type-ahead demo

edit... oops, James beat me to it. laugh.gif

agree.gif client side scripting will do this for you, regardless of browser, .NET or backend ...

piece of german black forest cake ...
beerchug.gif Andy
dagdal1967
One word:

AJAX
Qarl
I found this too..

http://abstractvb.com/downloads/autocombo.asp


I was hung up on the "smart find" verbiage. Once you told me "type ahead", I have been finding all sorts of stuff.

You guys rock!

aktion035.gif
SirAndy
QUOTE(dagdal1967 @ Apr 24 2006, 03:10 PM) *

One word:

AJAX

i know some scripting code out there can be pretty messy, but you really think this is going to help?

AJAX confused24.gif


biggrin.gif Andy
dagdal1967
QUOTE(SirAndy @ Apr 24 2006, 02:15 PM) *

i know some scripting code out there can be pretty messy, but you really think this is going to help?

AJAX confused24.gif


biggrin.gif Andy



Better than the alternative...
Rand
laugh.gif

Hey, you guys are making me sentimental. I had to go dig up a picture of my pride and joy...









.







.






.






Jeroen
QUOTE(dagdal1967 @ Apr 25 2006, 12:10 AM) *

One word:

AJAX


FEYENOORD!!!
laugh.gif
Qarl
I gave the programmer some of the following information...

>>Here is the page. It includes source code. It uses the .net Autocombo box...

http://abstractvb.com/downloads/autocombo.asp

I found another version of this with some different source code...

http://www.formassembly.com/type-ahead/

Please look at the page above. If you click the target box, and start typing text, it will narrow the text down based on what you type.

Here is another company that offers an add-in module for .net applications

http://www.hallogram.com/gridex/gridexnet/<<


His response...

>>Please consider when ever user types into the page, the application has to post back to the server and redraw the screen. This can slow down functionality."
Rand
bs.gif

Nothing goes back to the server until the form is submitted. The type-ahead is ALL client side.
SirAndy
QUOTE(Qarl @ Apr 25 2006, 02:04 PM) *

>>Please consider when ever user types into the page, the application has to post back to the server and redraw the screen. This can slow down functionality."

WTF.gif please consider your programmer to be clueless ...


*client* side scripting is called *client* side because it all happens on the *clients* browser.
no talking back to the server needed ...


workflow:

get all entries for your dropdown from server, fill in dropdown box. add input box for user input.

when user types in input box, use *client* side JavaScript to loop through the entires in the dropdown list to find the next best match, highlight that match.
this can be done interactive, every time the input box changes (user typing) you do a quick run on the dropdown list, no need for any "go" button or such ...

really not all that difficult.

if your programmer can't do it, PM me and i'll have a look at it ...
type.gif Andy
lapuwali
There's a couple of ways to do this, really. If there's a LOT of data, it may be quite expensive to hand it all to the client on the first load. So, you hand it the first "rank" of data, then request the second "rank" when you know what it is. Repeat as necessary. You're trading off immediate response time with total response time, but the second method usually results in a better user experience when there's lots of data.



SirAndy
QUOTE(lapuwali @ Apr 25 2006, 02:51 PM) *

There's a couple of ways to do this, really. If there's a LOT of data, it may be quite expensive to hand it all to the client on the first load. So, you hand it the first "rank" of data, then request the second "rank" when you know what it is. Repeat as necessary. You're trading off immediate response time with total response time, but the second method usually results in a better user experience when there's lots of data.

yes, but only if we're talking 1000+ entries in the dropdown, at which point you should really re-design your user-interface anyways.

ever tried to find something in a dropdown with over 1000 entries?
blink.gif Andy

PS: that's why GUI design is a art in itself. if you have that many entries, break it down in smaller chunks, make 2 or more dropdowns that depend on each other.
like, the first selects the country, the second the state, the third the city, by then, you're down to a managable size list ...
Qarl
That's the issue.

In one area of the application, one list has 175+ choices, the other has 260+ choices

We're inputting data based upon something marked on a piece of paper. We know the data item we want to select.

It's all numerical codes

078.10
078.19
077.72
098.12

There are dozens and dozens of codes in the lists that begin with each digit 0-9.

Even just entering the first digit, then you have to scroll down through dozens of choices that begin with that digit. Type-ahead will work great because we already know specifically what we want.

There are other areas of our appplication that are from lists of insurance carriers.

We might have hundreds of insurance carrier names to begin with.
Aetna, Allstate, Allheath. Aarons Insurance.

We're trying to narrow down the list by entering what we know.. the first 3-4 characters.
Rand
You want the drop-down list to shrink to fewer options as you go... Now I see why the programmer mentioned round-trips. But still, it would be better to load the whole array of options once, then use client-side code to dynamically shrink the list.

I'm not sure that a pick-list is the correct way to go, given that many options.

This is unfolding more as we go, and that leads me to say we probably won't be able to give you the ultimate solution this way... the whole interface needs to be designed with the whole scope understood.
lapuwali
Exactly, so if you can narrow the field from 500 to 50 in the first character, then transmitting all 500 is a waste of time. Have enter the first char, then the client requests the list of 50 to display. If you can go from 500 to 5 in two characters, then don't make the request until they type two characters. All depends on your data.

You could be extra clever and even rank the results by popularity, so the first two characters return a list in order of most likely to be used.

SirAndy
QUOTE(lapuwali @ Apr 25 2006, 04:06 PM) *

Exactly, so if you can narrow the field from 500 to 50 in the first character, then transmitting all 500 is a waste of time. Have enter the first char, then the client requests the list of 50 to display. If you can go from 500 to 5 in two characters, then don't make the request until they type two characters. All depends on your data.

You could be extra clever and even rank the results by popularity, so the first two characters return a list in order of most likely to be used.

while i agree that this would be "neat", 260 choices is not all that much ...

it'll be easier and *faster* to just download the whole array once when the page loads and then do a quick javascript selection ...

as i said before, easy as pie. piece of cake. no problemo.
type.gif Andy
Rand
Agreed. You do NOT want to be doing a server round-trip in the middle of someone typing. Much better to load the whole array once than interrupt someone's typing to reload a page, making them wonder WTF is going on.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.