CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Listboxes don't behave as standard Windows ComboBoxes

Print topic Send  topic

Author Message
Paul Shearing
Posted: 01/03/2006, 9:14 AM

I am getting complaints from customers using my CCS application regarding the way in which listboxes work.

For example: Imagine a listbox that contains the names of all countries. The user clicks on the listbox and sees the first countries in the list. The target country is Japan so he/she types "J". The first country that starts with "J" is displayed - Jamaica, so the user types the second letter "a" and the list switches to countries starting with "A" - Abu Dhabi :(. Normally the user would type only enough letters to uniquely identify an item in a list (in this case "Jap"). Instead, the list keeps changing after each letter is typed.

This is completely unacceptable because a) it means that the keyboard shortcuts that users (and some developers - me included) prefer are useless and b) CCS applications do not behave as standard Windows applications.

Does anybody know how to get the CCS listboxes to behave correctly as far as responding to typed letters is concerned?

Kind regards

Paul Shearing :-/
Walter Kempees
Posted: 01/03/2006, 2:41 PM

Paul,

The behaviour you describe is standard WEB listbox behaviour, agree that
this is not standard WINDOWS behaviour.
You will have to search the forum for "type ahead"
http://forums.codecharge.com/posts.php?post_id=60864&s_keyword=type+ahead
peterr


Posts: 5971
Posted: 01/03/2006, 2:53 PM

Paul,
This has nothing to do with CCS, but this is how your Web browser works (like IE). You cannot easily change the standard behavior of Web applications. Web applications are not Windows applications and HTML listboxes are well defined, standardized and documented by the World Wide Web Consortium: http://www.w3.org/. There is also no such thing as "CCS application" and CCS simply creates standard HTML listbox. How it behaves is fully up to your Web browser.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Paul Shearing
Posted: 01/03/2006, 5:09 PM

Guys, you're quite right - the Web isn't Windows - I wasn't thinking straight - too much mulled wine and too many mince pies over the Christmas break has addled the few remaining brain cells (good thing my wife isn't reading this otherwise I would hear the gentle refrain: "break, what break?").

Walter, thanks very much for the link - I have incorporated the type-ahead code into one of my search forms. initially I thought that it was not working - or at least only working sporadically.

I have discovered that you need to type reasonably briskly otherwise the type-ahead forgets what has been typed so far and reverts to "Web mode".

This may confuse some of my (dimmer, arthritic or lazy) users (did I really just type that? Oh dear - some of them are quite nice people - no, really) - is it something that can be adjusted?

Kind regards

Paul

Once again the CCS forum has delivered in record time. Je suis tres impressed.

Walter Kempees
Posted: 01/03/2006, 5:24 PM

Je vous enpris.
I also have a version where you can change the milisecond WAIT cycle to your
needs, or discard with it all together.
It has documented that a pause will retrigger the list to the first
character typed.

Glad you liked it, I did and I

<PaulShearing@forum.codecharge (Paul Shearing)> schreef in bericht
news:643bb204ab45c3@news.codecharge.com...
> Guys, you're quite right - the Web isn't Windows - I wasn't thinking
> straight -
> too much mulled wine and too many mince pies over the Christmas break has
> addled the few remaining brain cells (good thing my wife isn't reading
> this
> otherwise I would hear the gentle refrain: "break, what break?").
>
> Walter, thanks very much for the link - I have incorporated the type-ahead
> code
> into one of my search forms. initially I thought that it was not working -
> or at
> least only working sporadically.
>
> I have discovered that you need to type reasonably briskly otherwise the
> type-ahead forgets what has been typed so far and reverts to "Web mode".
>
> This may confuse some of my (dimmer, arthritic or lazy) users (did I
> really
> just type that? Oh dear - some of them are quite nice people - no,
> really) - is
> it something that can be adjusted?
>
> Kind regards
>
> Paul
>
> Once again the CCS forum has delivered in record time. Je suis tres
> impressed.
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Paul Shearing
Posted: 01/03/2006, 6:33 PM

Hi Walter

The final part of your last message seemed to get truncated. I would be interested in your solution that has an adjustable delay.

Kind regards

Paul
Walter Kempees
Posted: 01/04/2006, 11:36 AM

It's a bit different from the one in the link but you can extract the idea.
Googled it a while ago

  
//End JS Functions  
var typeAheadInfo = {last:0,  
currentString:"",  
delay:1000,  
timeout:null,  
reset:function() {this.last=0; this.currentString=""}  
};  
  
function typeAhead() {  
if (window.event && !window.event.ctrlKey) {  
var now = new Date();  
  
if (typeAheadInfo.currentString == "" || now - typeAheadInfo.last <   
typeAheadInfo.delay) {  
  
var myEvent = window.event;  
var selectElement = myEvent.srcElement;  
var keyCode = myEvent.keyCode;  
  
// The NumPad returns slightly differant keyCodes then the numbers on the   
type of the keyboard.  
// If we subtract 48 it will return the correct keyCode.  
if (keyCode >= 96 && keyCode <=105) {  
keyCode = keyCode - 48;  
}  
  
var newChar = String.fromCharCode(keyCode).toUpperCase();  
typeAheadInfo.currentString += newChar;  
  
var selectOptions = selectElement.options;  
var txt, nearest;  
for (var i = 0; i < selectOptions.length; i++) {  
// change this from .text to .value to use the value of the item instead of   
the visual text if desired  
txt = selectOptions.text.toUpperCase();  
nearest = (typeAheadInfo.currentString >  
txt.substr(0, typeAheadInfo.currentString.length)) ? i : nearest;  
  
if (txt.indexOf(typeAheadInfo.currentString) == 0) {  
clearTimeout(typeAheadInfo.timeout);  
typeAheadInfo.last = now;  
typeAheadInfo.timeout = setTimeout("typeAheadInfo.reset()",   
typeAheadInfo.delay);  
selectElement.selectedIndex = i;  
  
myEvent.cancelBubble = true;  
myEvent.returnValue = false;  
  
return false;  
}  
}  
if (nearest != null) {  
selectElement.selectedIndex = nearest;  
}  
} else {  
clearTimeout(typeAheadInfo.timeout);  
}  
typeAheadInfo.reset();  
}  
return true;  
}  
  



Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.