Results 1 to 4 of 4

Thread: Move Last, Previous, Next, First Buttons

  1. #1
    Join Date
    Jun 2004
    Kansas City, MO

    Move Last, Previous, Next, First Buttons

    WOW, is all i can say.
    I have a bunch of apps that run on the web and just had a user call me and say that the 4 seconds it takes to move to the next record is not acceptable. 4 Fuking seconds come on. Then wanted to know why we did not use like VB to create a intranet instead of web pages. This dude is a complete pain in the ass. Any way i want to look into how i am doing the move next, last, etc and see if i am doing it wrong. I cant believe that i am going to do this for an extra 1-2 seconds of load time, damn i am pissed right now. We have to many end users who need emails to tell them when to **** because if its not automated then they cant do there job. Bunch of lazy a$$ worthless people. Ok, ok its out of my system.

    This is how this is currently working, please let me know if there is a better way
    'this is not the sql statement just an example, the real sql is built on the fly
    'as it builds it self to the search criteria.
    objRS.Open, objConn, 3, 3
    if not objRS.EOF then 
         strAction = Request.form("MoveAction")
         Select Case strAction
                   Case "MoveNext"
                             varPosition  = Request.Form("Position")
    		objRS.AbsolutePosition = varPosition
    		If objRS.EOF Then
    		End If  
                   Case "MovePrev"
                             varPosition  = Request.Form("Position")
    		objRS.AbsolutePosition = varPosition
    		If objRS.BOF Then
    		End If  
                   Case "MoveLast"
                             varPosition  = Request.Form("Position")
    		objRS.AbsolutePosition = varPosition
                   Case "MoveFirst"
                             varPosition  = Request.Form("Position")
    		objRS.AbsolutePosition = varPosition
          End Select 
    End if
    <td colspan= 6 >
    	<Input Type=Button Name=cmdFirst Value="<<" title="Move to the First Record">
                 <Input Type=Button Name=cmdDown Value="<|" title="Move to the Previous Record">
    	<input type=label  value="<%=objRS.AbsolutePosition%> of <%=objRS.RecordCount%>" onfocus="blur()" id=label1 name=label1 size=10>
    	<Input Type=Button Name=cmdUp Value="|>" title="Move to the Next Record">
    	<Input Type=Button Name=cmdLast Value=">>" title="Move to the Last Record">
    <!--this is at the very end of the page-->
    <input type=hidden name=sqlWhereClause value="<%=sqlWhereClause%>"> 
    <input Type="Hidden" Size="4" Name="MoveAction" Value="Move">
    <input Type="Hidden" Size="4" Name="Position" Value="<%=objRS.AbsolutePosition%>">
    ok so the first time through the page, i create the where clause to be used. I save that in a hidden text field so i dont have to recreate it everytime the page is submited.

    I also store the absolute position in a hidden text box.

    When i click on the buttons it calles vbscript functions for the button, that basically set the MoveAction textbox with the value of the button that was clicked. Thats about it.

    I think 4 sec is acceptable but they want to see like 2 sec's. Is there a better way to do this or it this what they are going to have to live with.

  2. #2
    Join Date
    Dec 2004
    What you can do is take a copy of the page and add statements to display how much time is spent at each step in the process (before opening the connection, before building the SQL, before opening the record set, before each movement of the recordset pointer, before closing the recordset, before closing the connection, and before the end of your document). Then you will know where to concentrate your efforts and if there is anything to be done about it.

    Right off the bat, though, you can eliminate that first MoveFirst line. Upon creating a new recordset, the pointer is automatically on the first row already.
    Last edited by phpnovice; 05-03-2005 at 02:38 PM.

  3. #3
    Join Date
    Jun 2004
    Kansas City, MO
    ya, i located the problem the page was having. It had nothing to do w/ the code above. One of the search fields is a customer field. Well we have around 1000 customers that get loaded into the drop down. So what i did was, on the inital load, it takes about 4 secs, as it has to load all the customers. This allows you to search by a customer if need be. But after the search i set a boolean to dispaly a text box with the customers name from the DB instead of reloading all the customers into the drop down on each submit. Dropped the load time to 1 sec. So i guess i jumped the gun when i got all pissed at the client. Turns out my code was inefficient. Man am i eating my words now.

  4. #4
    Join Date
    Apr 2005
    instead of populating a drop down box, i normally provide a link that brings up a window that they can scroll and click the item they want to use in that box. you just need a couple javascript functions and its a lot more user friendly than a plain drop down. it also defers the load of all the customers to that window only if they need it. in a lot of applications that i have done, many of the users know their customer numbers already and just want to type it in. for longer lists i have even used anchor tags at the top of that window for each letter in the alphabet.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.37471 seconds
  • Memory Usage 2,861KB
  • Queries Executed 13 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates