Using a4j to load a rich:dataTable after the page loads

I have a rich:dataTable that calls a session bean which executes an SQL query to generate the data to be displayed in the table. Something simple like:
<rich:dataTable rowClasses="evenRow,oddRow"
rows="30"
value="#{Bean.items}"
var="items">
where Bean.getItems() performs an SQL query and returns List<Item>.
The problem is that the query takes a long time to execute (~45 seconds) and I'd like the page to initially load while the query is being executed, displaying a spinner while it loads. Once the query is done, I'd like to update the initially empty table using ajax.
I set up a spinner using a4j:status and it works fine after the page initially loads (using a rich:datascroller).
However, the page will not initially load until the query completes, which is a problem because the query is so slow. What happens is the user clicks on the "List Items" tab from my site's homepage, sits there on the same page for 45 seconds with absolutely no visual indication that anything is happening, and then finally is taken to the list of items page.
What is needed to make the dataTable load via AJAX the first time, as well as all subsequent times?
Thanks!
Edited by: rcrowell on Sep 8, 2008 5:42 PM

rcrowell wrote:
The issue isn't the PK of the table; the query is joining across many tables and aggregating data from one table in particular with millions of rows. The table has paging, but again that won't help the timinig issues due to the aggregation that must be performed on a large table.
Surely there must be a way to get the dataTable to always load its data via ajax, and not only after the first time.Well JSF does not have AJAX built-in, so why would there be? Perhaps one of the AJAX-based frameworks has this. I imagine it wouldn't be hard to do with the existing AJAX frameworks even without a built-in component specifically for it. Trigger an AJAX action on load which rerenders a panel which will only contain the dataTable upon the rerendering.
>
I think I could do it by adding a 'dataTableRendered' variable to the bean and using a jsFunction to set this variable to True when the page loads, but I'm looking for a better way. (I'm also not 100% sure this would do what I want.)

Similar Messages

  • Date Picker has to submit the default value after the page load???

    Hello All,
    I have 2 date pickers 'Start' and 'End' on a screen with report that has a where clause using above values. Start defaults to current date, End defaults to current month end date, I have another radio group with default to Monthly......
    Now when the page loads, I see the default values for 'Start' and 'End' date pickers but the report doesn't reflect those values. I added an on change dynamic action, and so when I change the value of 'End' date picker, it submits the page and now the values are reflected in the report........
    I tried creating another dynamic action > with event On Page Load.....and disable fire on page load, and to submit the page, this is causing an infinite loop of submitions........can you please tell me how to achieve this with out putting an exclusive submit button on the Screen.......
    Thanks for your time.
    DK

    user12296343 wrote:
    Hello All,
    I have 2 date pickers 'Start' and 'End' on a screen with report that has a where clause using above values. Start defaults to current date, End defaults to current month end date, I have another radio group with default to Monthly......
    Now when the page loads, I see the default values for 'Start' and 'End' date pickers but the report doesn't reflect those values. I added an on change dynamic action, and so when I change the value of 'End' date picker, it submits the page and now the values are reflected in the report........
    I tried creating another dynamic action > with event On Page Load.....and disable fire on page load, and to submit the page, this is causing an infinite loop of submitions........can you please tell me how to achieve this with out putting an exclusive submit button on the Screen.......
    Thanks for your time.
    You don't have to submit the page here.
    What version of apex?
    What report is it? i.e. Interactive report/Classic report
    Depending on your version of apex you can simply use the Page Items to Submit attribute to set the session state

  • Load image on mouseover after the page is showed

    hi guys, i have a slideshow with 30 images and it load all the image until show the page but it takes amount 6-7 second..is there a method to load only a thumbnail and show the page and when i click or mouseover on thumbnail load dinamically the image...... i think it can be done changing the image src ....

    You can also download a demo here: Re: Does the "same origin policy" apply to Animate? post#1: the flickrJSON link
    Then you load the "FlickrJSONButtons.an" file and
    You replace:
    sym.$("button1").bind("click", function(){ loadFlickr("amazing") });
    sym.$("button2").bind("click", function(){ loadFlickr("charlie") });
    By:
    sym.$("button1").bind("mouseover", function(){ loadFlickr("amazing") });
    sym.$("button2").bind("mouseover", function(){ loadFlickr("charlie") });

  • APEX dynamic action - How to hide an item after the page loads

    Hello
    I have a form  with  item  Type,  lesson and page.   I want to create a  dynamic action like "on page load" if Type = x then don't show lesson and page items. .
    How do I say if Type=x then  don't show lesson and page. otherwise show them.
    Please note Dynamic action,  Event=Page load
    Thanks

    create dynamic action like
    Event:Change
    Selection Type:Item
    Item:Type
    Condition:Equal To
    value:X
    Select Action:Hide
    Select Items to hide
    also create opposite false action
    and click on page checkbox below action to yes
    Hope this may helps
    pars.

  • After updating to the latest version of Firefox on my Mac there is no progress bar for the page load. I really miss this feature and can't seem to find a way to obtain it.

    The page load progress bar that was on the lower right of the window is no longer there. After updating to the latest version of Firefox on my Mac there is no progress bar for the page load. I really miss this feature and can't seem to find a way to obtain it. The tab has a circular progress wheel but this is useless for determining a stuck or slow loading page.
    PLEASE NOTE: I am typing this in from a Windows based work computer but am asking about my Apple MacBook Pro that i use at home.

    Firefox 4 saves the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session at any time.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.<br />
    Another possibility is to use:
    * [http://kb.mozillazine.org/Menu_differences Firefox (Tools) > Options] > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

  • Iphone 3g shuts off after the apple loading screen then cuts back on

    Iphone 3g shuts off after the apple loading screen then cuts back on by its self but when i connect it to a charger it works fine also my on/off button is unresponsive (i havent dropped it or wet it so im confused why its doing this)

    Welcome to the discussions,
    normally you could try to reset the phone by holding the sleep and home button until the Apple logo comes back. But since the sleep button is unresponsive, try to restore "as new iPhone", if necessary without using the backup afterwards, in case the backup contains corrupt data.
    Restoring: http://support.apple.com/kb/HT1414

  • When I open another Tab and type in a website address, after the site loads the URL in the navigation bar disappears. Why?

    When I open a new tab and type in the website url, after the website loads the website url disappears. In order for me to get it to come back, I have to right click on the navigation bar and click undo. why is this?

    Did this happen immediately after the reset or at a later time?
    Does this only happen on a new tab?
    What is the current setting for the new tab page as set via the browser.newtab.url pref?
    You can open the <b>about:config</b> page via the location bar.
    *http://kb.mozillazine.org/about:config
    Rename or delete the prefs.js file and possible numbered prefs-##.js and user.js files to reset all prefs to the default value.
    *http://kb.mozillazine.org/Preferences_not_saved
    *http://kb.mozillazine.org/Resetting_preferences

  • When I add pictures into MUSE , do the pictures resize for web quality (And so the page loads fast enough) or do I have to do this using an external software like photoshop, etc. ? Thank You

    When I add pictures into MUSE , do the pictures resize for web quality (And so the page loads fast enough) or do I have to do this using an external software like photoshop, etc. ?
    Also is there any way I can change the contact form email for all of my contact forms at once.
    I have over 100 contact forms and i want to make them reach the same email anyway I can do that without going one by one?

    If you have placed the image in Muse using File > Place and then scaled the image down in Muse while editing, then Muse publishes/exports the scaled down/optimized image in final output. When using as a Fill, the output size depends on the Fitting option you setup in the Fill options.
    As for the contact form email, you would need to specify the email address for each form individually. There is no workflow to edit the same for multiple forms at a time.
    Cheers,
    Vikas

  • My Firefox is impossible to use. It is very very slow to change pages, load pages and so one.

    I already search and applied several suggestions found in Internet, but until now, no one solve the problem. Firefox is using much memory (600.000) and much CPU (100%) and work very slow to load new pages or update the pages loaded.
    I am using APP "Memory Fox" but is the same.

    hello VictorTrindade, please try to [[Reset Firefox – easily fix most problems|reset firefox]] and see if this can address the issue...
    please also make sure that firefox isn't blocked by your security software/firewall in any way.

  • How do I move the page-load progress meter from the bottom task bar to the top menu bar, or inside the top/header toolbar? I am currently using Firefox Version 3.6.19

    How do I move the page-load progress meter from the bottom task bar to the top menu bar, or inside the top/header toolbar? I am currently using Firefox Version 3.6.19.
    URL Eaddress: [email protected]

    You see the orange (on Linux gray) Firefox button if the Menu Bar is hidden, so you need to hide the Menu bar to get the new appearance.<br />
    If you need to access the hidden Menu bar then press F10 or hold down the Alt key to make the Menu Bar appear temporarily.<br />
    You can place the Tab Bar on top.
    * View > Toolbars : [ ] Menu Bar
    * View > Toolbars : [X] Tabs on Top
    The Tab bar only appears on the title bar if the Firefox window is maximized.

  • My Keyboard and touch-pad will work during post, but will not work after the os loads?

    I have a G60 and My Keyboard and touch-pad will work during post, but will not work after the os loads? Im running Windows 7, Anyone have any Ideas? I have already tried a hard reset, and safe mode???

    Try pressing the fn key and f2 to reach bios
    or
    try a usb mouse from your desktop
    S70-ABT2N22 Windows 7 Pro & 8.1Pro, C55-A5180 Windows 8.1****Click on White “Kudos” STAR to say thanks!****

  • After altering the "Processes" list in Task manager, almost all of my programs show the iTunes icon, and when I click on, for example, Firefox, iTunes will load. Uninstalling iTunes restores the normal loading of other programs, but re-installation of iT

    After altering the "Processes" list in Task manager, almost all of my programs show the iTunes icon, and when I click on, for example, Firefox, iTunes will load. Uninstalling iTunes restores the normal loading of other programs, but re-installation of iTunes makes the problem recur. Any answers?

    First I'd set up a System Restore point. Then try applying the LNK registry fix from the following document:
    File Association Fixes for Windows 7
    Does that get your icons back to normal?

  • When I click on a bookmark in the listing, nothing happens. If I right click and click on "Open In New Tab" the page loads. I am using version 14.0.1

    Firefox just updated to version 14.0.1. When I clicked on one of my book,marks from the listing, nothing happened. The page did not load. If I right click on the bookmark and choose " Open in a New Tab", the page loads in a new tab. None of my bookmarks will work by simplying clicking on them from the listing.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Firefox crashes as soon as the page loads it is completely unusable

    i got a update prompt from firefox a few hours ago which i installed and now it wont work as soon as the page loads it crashes it wont even stay on long enough to figure out the problem i swear by firefox i have used its for years and never had any problems with it ever if i recall but lately it has been freezing and crashing often i feel like i am using internet explorer and thats bad but now i cant get it to work at all and am forced to downgrade to a lesser program WHAT IS GOING ON????? as for crash ids and troubleshooting info none of that even comes up

    Do a clean (re)install:
    * Download a fresh Firefox copy and save the file to the desktop.
    * http://www.mozilla.com/firefox/all.html
    * Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    * Don't remove personal data if you uninstall the current version.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    * It may not be necessary to create a new profile, so first try if it works with your current profile and if not then create a new profile.
    Your bookmarks and other profile data are stored elsewhere (not in the Firefox program folder) and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    * http://kb.mozillazine.org/Profile_Manager
    * http://kb.mozillazine.org/Profile_backup
    * http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • My page generates an Excel file but sometimes fails if the page loads to slowly...

    I'm having a problem generating an Excel file using CF and
    looping over a bunch of queries to get a table of data to display
    to the user. This is slow but works fine except for an instance
    recently where the page seems to be loading but after a few minutes
    it stops and says "the page cannot be displayed". The error leads
    me to believe it is a server error and not a CF error but I'm not
    sure. I don't have timeout checked in my CF Admin so that should
    mean that I can request pages for as long as I need to right?
    I'm using the cfheader and cfcontent to dynamically generate
    an Excel spreadsheet from my HTML. I tried using the cfflush tag
    and that seemed to help since it pushes content to the browser
    during the page load but it doesn't work with the cfheader and
    cfcontent tags.
    So then I tried using the cfsavecontent tag and then save the
    HTML to a file but again I couldn't use the cfflush tag inside the
    cfsavecontent tag so now I'm stuck.
    The page DOES load when I run in on my local machine with MX
    6.1 Developer Edition and SQL Server Personal Edition. It DOES NOT
    work when I run it on my production server that then calls my
    separate database server. I'm wondering if there is a timeout (non
    CF) set somewhere on the productions server or the database server
    or if there is some sort of limit to the amount of data you can
    transfer between servers?
    I'm totally stumped now so any advice is greatly
    appreciated!

    That didn't work for me and the page times out right about 5
    minutes (300 seconds). I don't have timeout checked in the CF
    Administrator so I don't think it is CF that is causing the
    timeout. I checked IIS also and the timeout is set to 900 seconds.
    Is there a possibility that SQL Server has some sort of
    connection limit and I'm using too many cfquery tags? If anyone has
    experienced a similar problem I would really appreciate the help,
    thanks.

Maybe you are looking for