Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Christchurch, NZ
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How to force dynamic content to screen, client-side only?

    Hi All,

    I'm working on a javascript-only application that queries an in-memory database, at times requests (all internal to the JS app) are lengthy, so I need to post a "Processing..." overlay atop the clicked UI tab to provide user feedback that something is actually happening. For the life of me I cannot figure out how to push the "Processing..." content to the screen while the DB lookup is underway. It appears that there's only one shot at updating the display, and that's when all JS processing has concluded (ie, the data has been looked up and is displayed). Any tips would be greatly appreciated, what I wish to do may not be possible?

    Thanks in advance for your assistance!

    JD

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    Hi, unfortunately none of this means anything to us with no actual code included.

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Christchurch, NZ
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Here's the code snippets!

    Fair enough. I was fishing for more of a general feedback, like "use this function to ....", however, you have a good point, you are working blind on this...

    Here is the <td> for the GUI tab that is clicked to initiate the DB search:

    Code:
              <td id="search_results_tab" width="260px" class="tab-inactive-results" onclick=" _displaySearchResults ( 'tab' ) ;return false;">
                <span id="search_results_label"><strong>Search Results</strong></span>
                <span id="search_results_loading_msg" style="display:none;"><strong>Processing...</strong></span>
              </td>
    And here is the start and end of the _displaySearchResults () function call, as you can see, I'm just simply hiding and showing the various bits to post the "Processing..." message. The end result of all this is I never see the "Processing..." label, that's the issue...

    Code:
    function _displaySearchResults ( _origin ) {
    
      $ ( 'search_results_loading_msg' ) .style.display = '' ;
      $ ( 'search_results_label' ) .style.display = 'none' ;
    
    ... DB lookup and results render logic is here ...
    
      $ ( 'search_results_loading_msg' ) .style.display = 'none' ;
      $ ( 'search_results_label' ) .style.display = '' ;
    }
    Cheers,

    JD

  • #4
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Christchurch, NZ
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem Solved!

    More poking around on the web resulted in finding the solution. I just have to post an event (via setTimeout()) that performs the DB search and results display. Prior to the event call I post the "Processing..." message. Pretty simple, actually, just what I was hoping for.

    JD

    Here's the code:

    Code:
              <td id="search_results_tab" width="260px" class="tab-inactive-results" style="background-color:#FF9900" onclick=" _displayProcessingMessage ( 'search_results' ) ; setTimeout( '_displaySearchResults ( \'tab\' )', 0 ) ; return false;">
                <span id="search_results_label"><strong>Search Results</strong><span id="showTimeMetrics"></span></span>
                <span id="search_results_loading_msg" style="display:none;"><strong>Loading...</strong></span>
              </td>


  •  

    Posting Permissions

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