Ajax Update of a rich:subTable with rich:dataTable

Hello,
i just want to rerender a subtable within a dataTable via ajax request.
The concrete requirement is just to model a 1-level table tree, such that i am
able to expand items in the superior table. I have tried different solutions.
One is, that value.items returns an empty list on not expanded,
other was to use the rendered attribute at the subtable and/or also
at a wrapping columngroup.
Another thing is, that the table obviously requests the
ajaxKeys attribute at the dataTable, it also returned
the correkt rows (as integer index keys within a Set),
but the subtable is never refreshed.
I have no more idea! Do i only have the possibility
to update the whole table (this works fine) ?
When do i really need the ajaxKeys attribute?
My third question by this way is, is there a nice
way of doing it using pure client side javascript effects?
Hope you can help,
Ijaja
<rich:dataTable      value="#{bean.list}" var="value" id="table">
     <rich:column colspan="2">
          <a4j:commandLink action="#{value.switchExpanded()}" reRender="subtable">
               <h:graphicImage id="expandimage" value="#{value.image}"/>
          </a4j:commandLink>
          <h:outputText value="Text"/>
     </rich:column>
     <rich:subTable id="subtable" value="#{value.items}" var="item">
          <rich:column>
               <h:outputText value="#{item.label1}" />
          </rich:column>
          <rich:column>
               <h:outputText value="#{item.label2}" />
          </rich:column>
     </rich:subTable>
</rich:dataTable>

Hi, thanks for your reply. I looked at the ajax code in that post.
attrResponse should be called from my Action class (controller class in my case since am using spring)
However, this is extremely useful if I am expecting the user to do an input for me.
I need to figure out if a Query is updating table abc ( I plan to do it this way :
I will get the table name from all update queries being executed (this I dont know how I will do though), and then after the successfull updation I will execute the select query for the same table) and then return the result set in the attrResponse.
ultimately this will help in updating rows displayed in jsp based on updates done to the database without the page being refreshed. For ex, if my current Jsp is displaying my total no. of employees, which is 2 then if someone updates the table with a third employee, then the third row gets automatically updated.
am I taking it up in the correct way ?
Is there another way to do this ?
Thanks for your time on this.

Similar Messages

  • Problem with rich datatable

    Hi, there.
    I'm a newbie in JSF and was trying to build a rich datatable.
    Using the docs of this page I was able to build the header but not a sub table:
    <rich:dataTable
    cellpadding="0" cellspacing="0"
    width="780" border="0">
    <f:facet name="header">
         <rich:columnGroup>
              <rich:column>
                   <rich:spacer />
              </rich:column>
              <rich:column>
                   <h:outputText value="Nome" />
              </rich:column>
              <rich:column>
                   <h:outputText value="Canal" />
              </rich:column>     
              <rich:column>
                   <h:outputText value="PT" />
              </rich:column>
              <rich:column>
                   <h:outputText value="EN" />
              </rich:column>
         </rich:columnGroup>
    </f:facet>
    <rich:subTable>
    <rich:column>
         <h:outputText value="batatas"></h:outputText>
         <f:facet name="footer">
              <rich:spacer />
         </f:facet>
    </rich:column>
    </rich:subTable>
    </rich:dataTable>
    What is wrong with this code? Can anyone help me?
    Thanks in advance.

    But this code shouldn't show anything in the browser?
    I know that I didn't feed it. I've started to test it using hard coded values...

  • Entity selected from the rich:dataTable with paging issue

    I tend to use rich:dataTable and retrieve entities clicked with this code.
         public final static Object selecionado(final String formulario,final String tabela) {
              try {
                   final UIComponent comp = FacesContext.getCurrentInstance().getViewRoot().findComponent(formulario);
                   final javax.faces.component.UIData data = (javax.faces.component.UIData) comp.findComponent(tabela);
                   return data.getRowData();
              } catch (final Exception e) {
                   throw new IllegalArgumentException("There was an error on select entity from table.\n" +
                             "Form = " +formulario+"\n" +"Tabela:" +tabela+"\n" +"Look up if the names are correct. <h:form id=\""
                             +formulario+"\"> e"+" <h:dataTable id=\""+tabela+">",e);
         }{code}
    ps: I create a column of type h:commandlink and its call to action (which performs this method to see which entity was selected).
    It works perfectly on the first page (rich:datascroller) but when I navigate to another page and click on the link (edit) the code is not even executed (I confirm this on debug mode too) and what happens is that the paging sends me back to page one.
    Is there anything I can do?
    Best regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I'm assuming you have <h:messages/> on your page?
    The action events are queued during the Apply Request Values phase of the request. Typically if an action is not queued it is because some state of the components is not same as it was during the Render Response of the previous request. For example, if the value of the rendered attribute somehow changed, a component will not queue an action if it thinks it was not rendered.
    It your case the most likely thing to have changed seems to be the pagination state of the dataTable. The table thinks it is on the first page for some reason during the Apply Request Values phase and so iterates over the data in the first page and never discovers the request flag indicating that an event should be fired for data in the second page. So the action event is not queued, nothing happens in the Execute Action phase and the Render Response phase simply re-renders the existing view.

  • 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.)

  • Spry and ajax.updater

    Hi, I'm working in an idea using Prototype ajax.updater to
    load an external HTML (that has spry scripts) inside a div. The
    thing is that it doesn´t work. The external HTML load ok in
    the div but the spry script doesn´t be executed. SOme one can
    help me with this? Thanks in advance from Argentina!

    You certainly can talk to CF5 (or any server software) from
    Spry.
    Beyond what Don has added, I'll say also that 2 things could
    things from working if you just try to rename an xml file as .cfm.
    First, if you have debugging enabled, then the bottom of your page
    will now have the HTML debugging output--Spry (or any Ajax client
    that expectsw pure XML) won't like that. Also, changing it to .cfm
    also means CF will return the data with an http content-type or
    "text/html" when it needs to be "text.html".
    I explain how to solve these two (and related problems) in
    this blog entry:
    http://carehart.org/blog/client/index.cfm/2006/7/13/spry4_unexpected_server_results

  • Windows Update Client failed to detect with error 0xc8000247 after using Lenovo System Update 5

    My Windows 7, SP1 was running fine, until I installed few updates on 10/15 using Lenovo System Update 5 then Windows Update stopped working, shows as RED:
    {CE3119AD-35EF-41CF-9C21-C7698FEB8393}    2013-10-14 21:53:00:256-0700    1    147    101    {00000000-0000-0000-0000-000000000000}    0    0    AutomaticUpdates    Success    Software Synchronization    Windows Update Client successfully detected 4 updates.
    {EB17A01A-EB6E-49FF-9EA2-AA0DD063B4B1}    2013-10-15 04:15:54:069-0700    1    162    101    {C61A0D00-3E51-48AC-B0AF-1D3E02B9E5D3}    201    0    AutomaticUpdates    Success    Content Download    Download succeeded.
    {77DAE88F-2795-4258-8BBF-8D27E53662CF}    2013-10-15 12:10:38:196-0700    1    193    102    {00000000-0000-0000-0000-000000000000}    0    0    AutomaticUpdates    Success    Content Install    Restart Required: To complete the installation of the following updates, the computer must be restarted. Until this computer has been restarted, Windows cannot search for or download new updates:  - Security Update for Windows 7 for x64-based Systems (KB2862330)
    {1398F777-3AEF-4D1D-BE4C-407EC4AEAD4C}    2013-10-15 12:15:25:676-0700    1    183    101    {C61A0D00-3E51-48AC-B0AF-1D3E02B9E5D3}    201    0    AutomaticUpdates    Success    Content Install    Installation Successful: Windows successfully installed the following update: Security Update for Windows 7 for x64-based Systems (KB2862330)
    {A220898A-E5FE-4FE7-8413-2B0C7B4013D0}    2013-10-15 12:15:25:766-0700    1    202    102    {00000000-0000-0000-0000-000000000000}    0    0    AutomaticUpdates    Success    Content Install    Reboot completed.
    {A5400FF2-33ED-4A47-8409-13E5DFE16A6D}    2013-10-15 19:29:31:486-0700    1    147    101    {00000000-0000-0000-0000-000000000000}    0    0    ChkWuDrv    Success    Software Synchronization    Windows Update Client successfully detected 0 updates.
    {43C533EE-775D-445E-A652-06648B72DE65}    2013-10-15 19:29:49:702-0700    1    147    101    {00000000-0000-0000-0000-000000000000}    0    0    ChkWuDrv    Success    Software Synchronization    Windows Update Client successfully detected 0 updates.
    {D6AAAFFB-7F18-4A7E-B39D-1BA09CDC5E6D}    2013-10-15 19:30:05:744-0700    1    147    101    {00000000-0000-0000-0000-000000000000}    0    0    AutomaticUpdates    Success    Software Synchronization    Windows Update Client successfully detected 3 updates.
    {4E73B1C1-5BA2-415D-AB34-92F7AB3DB418}    2013-10-15 19:30:08:753-0700    1    147    101    {00000000-0000-0000-0000-000000000000}    0    0    ChkWuDrv    Success    Software Synchronization    Windows Update Client successfully detected 0 updates.
    {51248882-41AC-4E59-B813-87AD326310AD}    2013-10-15 20:00:05:044-0700    1    183    101    {DBD3B4E9-0357-47DA-8317-D0CF2163BFE6}    501    0    wusa    Success    Content Install    Installation Successful: Windows successfully installed the following update: Hotfix for Windows (KB2661796)
    {FB2B8E5E-442C-4E76-B23D-6A41B4324C9D}    2013-10-16 00:11:39:832-0700    1    148    101    {00000000-0000-0000-0000-000000000000}    0    c8000247    AutomaticUpdates    Failure    Software Synchronization    Windows Update Client failed to detect with error 0xc8000247.
    Lenovo Thinkpad W500, Intel (R), Windows 7, SP1, latest updates as of Oct 15
    (1) Checked Setting,  set to automatic update whenever, even changed to never update, rebooted the OS and changed back to automatic update and rebooted the OS.
    (2) Stopped Windows Update Services, renamed SoftwareDistribution folder and started the window update services and rebooted.
    (3) Ran MS FIXIT
    (4) Ran System File checker Scan (sfc /scannow)
    (5) Ran CHKDSK /F
    (6) Installed "Intel Rapid Storage Technology" drivers from Lenovo site
    (7) Ran Update for Windows 7 for x64-based Systems (KB971033)
    None of the above possible recommended solutions were able to fix the issue yet and now I am getting a message your Window is Not Genuine!
    Any help or guidance is appreciated.
    Solved!
    Go to Solution.

    The Lenovo System Update installed the "Intel Matrix Storage Manager driver 8.9.2.1002" right before the Windows Upgrade got broken. So in the Device Manager under IDE ATA/ATAPI Controllers, I choose Intel ICH9M-E/M SATA AHCI Controller, on the Driver Tab, I choose the option "Roll Back Driver" and after rolling back the driver and restarting the OS, now Windows Update is working like a Champ!
    The End!

  • Why is it when i update my status on facebook from iohone it splits the updates into two differents boxes with some funky symbol. I have uninstall facebook and installed it over and it still does it. only the facebook IPHONE app.

    why is it when i update my status on facebook from iphone it splits the updates into two differents boxes with some funky symbols at the beginning.. I have uninstall facebook and installed it over and it still does it. only the facebook IPHONE app where it says to update staus text to FBOOK  i have already update my phone too.
    if i go on the facebook site and update there through a brower on iphone it will work fine just cant us IPHONE mobile upload,  . But its a pain of not using my IPHONE APP for facebook cause it does that.

    The warranty entitles you to complimentary phone support for the first 90 days of ownership.

  • Why can I not disable the guest user in the 10.8.2 update? I have never enabled the guest user, but after the update, it was automatically enabled with a "managed" tag. It is not selectable even after entering my admin password to unlock the options.

    Why can I not disable the guest user in the 10.8.2 update? I have never enabled the guest user, but after the update, it was automatically enabled with a "managed" tag. It is not selectable even after entering my admin password to unlock the options. I was able to select the account under "parental controls", but again, could not delete it. Why Apple? Why?!!????

    SOLVED Ok. I actually was able to disable it. I had to actually log in as the guest user to make it accessible in the preference window. Then I disabled it and logged out. Apologies if this was obvious for some people, but I have had some sort of issue with something every update since Snow Leopard.

  • My iphone 5 wont let me update apps keeps popping up with old apple id how do i fix this

    my iphone 5 wont let me update apps keeps popping up with old apple id how do i fix this??

    All apps downloaded/purchased are tied to the apple ID used to download/purchase them.
    If you change your Apple ID and do not wish to use the old apple ID and password to update them, you have to delete them and redownload or buy them under the new apple ID.

  • After updating to ios 7.1 with my iphone 4 my apps wont update it just loads then stop help please

    after updating to ios 7.1 with my iphone 4 my apps wont update it just loads then stop help please

    Reset your iPhone.  Hold the on/off and home buttons together for about 10 seconds till the Apple logo appears.
    If you continue to have issues, try downloading the apps to iTunes on your computer, then sync your iPhone using iTunes.

  • I have updated my 4S i phone with ios 8.1.2, while activating i forgot my password, i am able to sign in my apple id in pc but not not able to sign in my i phone and  message- your apple id has been disable for security reasons please help

    I have updated my 4S i phone with ios 8.1.2, while activating my iphone, i forgot my password. I am able to sign in my apple id in pc (manage my account) but not not able to sign in my i phone and  message- your apple id has been disable for security reasons please help.
    my apple id is with extension @ gmail.com but for activation it is mentioned that it is linked with extension of @me.com

    Hi ulhas1frombanihal,
    Welcome to the Support Communities!  Because your account has been disabled, you will need to contact Apple ID account security to straighten this out.
    Contact Apple for help with Apple ID account security - Apple Support
    http://support.apple.com/en-us/HT5699
    I hope this information helps ....
    - Judy

  • How do I retain my apps after I change my apple ID? Right now I'm unable to update any of the apps with the old apple ID. I get an error message about an invalid id or password. If I delete my apps and start over, I may lose the apps that I purchased...

    How do I retain my apps after I change my apple ID? Right now I'm unable to update any of the apps with the old apple ID. I get an error message about an invalid id or Password. If I delete my appos and start over, I may lose the apps that I purchased (like the ones for $5 +....

    Apps are always tied to the ID that was used to purchase them originally. Did you try entering your old password and see if that works?
    If you need to sign out of your old account go to Settings>Store>Tap on your ID and sign out. Sign in with the new one.
    you can also access your ID in the featured tab of the App Store. Swipe to the bottom of the screen and you will find it there as well.

  • How can i use Itunes to update more than one IPad with more than one owner

    How can i use Itunes to update more than one IPad with more than one owner?  I own an IPad and my wife owns an IPad.  I want to use my system to update both IPads.  We have different Apple Accounts and different applications.  Is this possible?

    Of course, that is too easy.  I am such a bonehead.

  • I recently updated my e-mail address with apple, but now it does not show all the "purchased" music that I purchased under my old e-mail address.  How can I re-gain access to those hundreds of purchased songs?

    I recently updated my e-mail address with apple, but now it does not show all the "purchased" music that I purchased under my old e-mail address.  How can I re-gain access to those hundreds of purchased songs?

    You are trying to find a loophole to circumvent a basic rule that prohibits the transfer of purchased content from one Apple ID to another.
    Content tied to an Apple ID are bound to that Apple ID forever. You can not merge or trade accounts. Well, not (officially) anyway...

  • I can't update the purchases I made with the old Apple I.D. How can I sync my old Apple I.D. with new one?

    I can't update the purchases I made with the old Apple I.D;
    how can I sync my old Apple I.D. with new one?

    Only the Apple ID used to buy an app can update an app. Apple does not merge Apple IDs and Apple does not transfer content biught with one ID to another ID.

Maybe you are looking for

  • Line separator to get multiple records in one variable

    Hi Experts, I have a requirement where i need to get data in the below form , in exactly one variable. Invoice No.       Inv. Date      Voucher   Gross Amount    TDS Amount     Discount    Paid Amount   986013092,17   04/08/2010    00091217   32415.0

  • How to use Hotmail with my iPad2

    I have my iPad2 set up so it is using my DSL router through ethenet.  I also went through the steps: Settings/Mail Contacts Calendars/Hotmail Exchange and got my Hotmail Account information verified. I can get on Hotmail and can type into the Address

  • How can you scroll between mail messages in Lion mail?

    In leopard and snow leopard, you could scroll between messages in mail with a 3 finger gesture.  this feature seems to be disabled in lion....or am i missing something?  Is there any way to use gestures to scroll between messages in mail?

  • IPad1: Can apps be installed from desktop iTunes?

    I recently purchased a new iPad (1st gen) and want to install some apps that are currently downloaded onto my desktop iTunes.  I do not have Wi-Fi where I live.  I've tried to drag and drop the apps to the iPad, but when iTunes syncs with the iPad, t

  • Francois, Java Input Box

    Hello Francois, I tried adding a bean area to one of my forms and stepping through your page:- http://sheikyerbouti.developpez.com/inputdialog/files/inputdialog.pdf I have attempted to run this form, I have forms 10g. Update formsweb.cfg to add the n