• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Delay while I type characters in the text box

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Need help in how to code in such a way that, I should get all the elements of the xml document initially when the page first loads (or something like that) and store the elements in some JavaScript data structure. So that, for subsequent access I can access from that data structure rather than invoking the xml parsing api every time.
[ June 06, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AJAX?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Mike Corleone", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Naveen, your subject line and your topic seem to have little to do with each other. Please clarify.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apologies. I have now changed my display name.
[ June 06, 2006: Message edited by: Lynette Dawson ]
 
Naveen Morrise
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a JSP page where <form id="frmCreateMain" name="frmCreateMain" method="post" action="matchToPreexisting.jsp" target="addrstand"> has call to the database, which is causing the delay in sending a XML response back which is getting parsed on everykey stroke which is time consuming. So, some how I need to get this delay reduced.

Here the scenario works like below:

The front end is the JSP Page that is displayed to the normal user.

Any thing that is displayed on the GUI, that might be either label or the text box or might be any thing is being populated from XML file.

The underneath XSL file is generating the HTML file based on the XML at the GUI.

And my understanding of the code is correct and sure.

So, if some one can help me in giving me the idea why in the GUI it displays characters or numbers after a while. The amount of delay is significant and can be seen even by the normal user. This is the reason only, why I am thinking how to code in such a way that, getting all the elements of the xml document initially when the page first loads (or something like that) and store the elements in CustomerCreate JavaScript data structure. So that, for subsequent access you can access from that data structure rather than invoking the xml parsing api every time .
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're submitting the form on every keystroke?
 
Naveen Morrise
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you are right
 
Naveen Morrise
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is coded like that. I am new to the team. But the one who developed did like that.

and I need how to improve the code.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use the onchange event trigger instead of one of the keystroke events, the form won't be submitted until the user leaves the given field.
 
Naveen Morrise
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have onkeyup function right now

fName.attachEvent('onkeyup',initName);

So, do I have to change it or not. Please correct me.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think about when you want the event to be fired.

If you want it to happen with each keystroke and don't mind waiting, leave it as it is. If you don't want it fired until the user is done working with the given field, use the onchange or onblur event triggers instead.
 
Naveen Morrise
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, Can I use

fName.attachEvent('onChange',initName);
or
fName.attachEvent('onBlur',initName);

lines of code for my purpose
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As this has become more about client-side code than JSP, I've moved this to the HTML forum.
 
Naveen Morrise
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can any one help in this regards by looking the above series of forum
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you search Google for Ajax autocomplete and see if that helps give you an idea.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic