Fixed: How to remember the DataTable state and still use buttons

Lets say that you have a DataTable on a page, with a bunch of hyper links and buttons on the same page (for navigation to various parts of your application). If you use the built in pagination and sorting, you will find that the following behaviour:
1. DataTable remembers its state (sorting, page number, etc.) if you click on any hyper link. You can even go back to a different page, and then come back to the original page to find that your DataTable is in the state you left it (very cool, it is session scope and works as intended).
2. If you click on any button, DataTable does not remember its previous state (goes back to page 1 and default worting, etc.). After playing around with it and going nuts, I discovered the way to use Button and still have the DataTable remember its state. I wanted to share it with the rest of you:
    public String btnClose_action() {
        try {
            this.getExternalContext().redirect("faces/users.jsp");
        } catch (Exception ex) {
            log("Error: userDetail > btnClose_action", ex);
        return null;
    }This was my original post:
http://swforum.sun.com/jive/thread.jspa?threadID=103583
Message was edited by:
Sabir

II think there should be a property
to disable form submission on buttons. There is!
To make the form not be submitted by a button click:
1. In the Visual Designer, select the button.
2. In the Properties window set the JavaScript > onClick property to return false;
This might interest you: http://blogs.sun.com/divas/entry/disabling_a_button_after_it

Similar Messages

  • Can i unplug time capsule from the ethernet cable and still use it??

    can i unplug time capsule from the ethernet cable and still use it??

    I have tried to extend that wireless line but as soon as i remove the LAN cable i have no internet connection anymore. So basically, does the TC get the signal wireless from the router??
    The Time Capsule can wirelessly extend a wireless signal....but only if it is being provided by another Apple AirPort wireless router.
    If the "main" rotuer there is not an Apple AirPort router,  you will need to connect to the network using a wired Ethernet connection.

  • How to test the JSP pages and sevlets using JUnit. ?

    How to test the JSP pages using JUnit. How to configure what are all the steps to execute the JUnit test cases.

    Hi xiepei,
    since you are using modbus, a simple error checking is implicit in the protocol and is the comparison between returned checksum and the calculated one on the received message: checksum errors, if any, are an effect of communications errors (you should have at least 2 bits changed and on particular patterns to have the checksum be calculated correctly!). You won't be able to calculate BER on them, but you can calculate PER (Packet Error Rate).
    Another flag for communication errors, on the other direction, is to intercept error messages from the device: if it fully implements modbus protocol, it should return some warning in case of error (I seem to remember that in some cases it returns the reveived message with some error bits added: please check in modbus documentation).
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Anyone know how to add audio without image and still use autoplay feature?

    Does anyone know how I can add audio to a webpage without having to add an image and still be able to use the autoplay feature? Adding as hyperlink doesn't accomplish what I'm after. Thanks in advance for the education!

    You can use the "hidden" song file method...
    http://roddymckay.com/Satellite/CatchTheTide.html
    You don't have to hide it completely if you don't want to - just reduce it to a small dot.

  • Can you deactivate the phone feature and still use an iphone?

    Can you deactivate the phone feature and use an iphone as an ipod touch and still sync with iTunes?? I would like multiple answers so I can compare.
    Message was edited by: theharrypottergeek

    You can remove the SIM card to prevent any cell phone services and use the iPhone as an iPod Touch.
    You can cancel your service with AT&T or use the SIM card with another phone, or get a new phone with AT&T using the SIM card that shipped with the new phone to activate phone and use the iPhone as an iPod Touch.
    In order to install a firmware update on a no longer activated iPhone, or restore a no longer activated iPhone with iTunes if wanted or needed, the no longer activated SIM card must be inserted in the iPhone to complete the process - the SIM card that was used with the iPhone when it was activated.

  • My husband has a iphone, now i have one to. We want to work with the same calendar, but i want to play in the game center with my own name... how can i do that? and still use the same calendar

    My husband has a iphone 4 8Gb, now i have one to. We want to manage our calendar with icloud. We use the apple id that my husband made, but i want to play in the game center with my one name and games. How can i do that?

    Sounds like you encrypted your iPhone backup, & if so it's asking for the encrypted backup password. Do you have a company Exchange account on your phone?

  • How to get the system date and time using java

    hi,
    I want system date in my out put. how to access system date. can v use utill packaegs (or) sql. which one is the best to get.
    Thanks & Regards,
    Kenny.

    import java.util.Date;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class MyClass {
    public void setTimeStamp() {
    int hour, minute, second, time = 0;
    Date dt=new Date();
    System.out.println(dt.getDate());
    System.out.println(dt.getMonth());
    System.out.println(dt.getYear());
    Calendar cal = new GregorianCalendar();
    hour = cal.get(Calendar.HOUR_OF_DAY);
    minute = cal.get(Calendar.MINUTE);
    second = + cal.get(Calendar.SECOND);
    System.out.println (hour + ":" + minute + ":" + second);
    public static void main (String args[]){
    MyClass app = new MyClass();
    app.setTimeStamp();
    }

  • How to remember the value in h:commandLink inside a h:datatable

    I have a h:dataTable storing header information, there is a column "refno" which is a h:commandlink (or h:outputlink) so user can select that column and jump to the detail page.
    My problem is how to remember the refno so I can use it in the detail page?
    a simplified code is as follows:
    <html>
        <body>
              <f:view>
                  <h:form id="select">
                  <h:dataTable value="#{dataTableBean.arr}" var="loc">
                      <h:column>
                          <f:facet name="header" >
                              <h:outputText value="Frameworks"/>
                          </f:facet>   
                          <h:outputLink value="openedTenderDetail.jsf"> // or h:commandLink
                                  <h:outputText value="#{loc.refNo}" />
                          </h:outputLink>                            
                     </h:column>
                 </h:dataTable>
              </f:view>
        </body>
    </html>

    hello
    u can use <f:param to remeber value and go to next page accordingly
    in detail
    use commandlink and in action get value of <f:param and then navigate to the desired page according to the param value
    regards
    Shakeel Abbas

  • How to find function module's and tables used for the particulat screen or TCODE?

    Hello Nation,
    I would like to know how to find the  function modules and tables used for the particular screen or TCODE or program.
    Example : I would like know the function module used in the program RDBGFT?
                     How can i find that?
    Thanks in advance ,Awaiting your reply.

    Make use of Find function  with the keyword "CALL FUNCTION".
    Make use of the same find function with the keyword "Select" to know the database tables used.
    Regards,
    Philip.

  • My ipod touch recently cracked the screen is not very broken, I'm from Brazil and bought my ipod touch in Miami want to know where I can fix it there in the united states

    my ipod touch recently cracked the screen is not very broken, I'm from Brazil and bought my ipod touch in Miami want to know where I can fix it there in the united states? And how much it would cost?

    Apple will not take it as a trade-in for an upgrade to an iPad touch
    The will take it for recycle only
    Your best bet is to sell it on your own and then use those funds to get the new iPod.
    Allan

  • My Ipad wont retrieve my new emails and if I try to check passwords in Settings, the settings window only stays open open for a second or two and the automatically closes. Any help on how to fix. I tried the turn off and on trick and that didn'

    My Ipad wont retrieve my new emails and if I try to check passwords in Settings, the settings window only stays open open for a second or two and the automatically closes. Any help on how to fix. I tried the turn off and on trick and that didn't work either. Thanks for any help.

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • I can't remember my security questions and have used the maximum number of tries, how do I find out what my answers are so I can log in and buy some music?

    I can't remember my security questions and have used the maximum number of tries, how do I find out what my answers are so I can log in and buy some music?

    From a Kappy  post
    The Best Alternatives for Security Questions and Rescue Mail
    1.  Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
    2.  Call Apple Support in your country: Customer Service: Contact Apple support.
    3.  Rescue email address and how to reset Apple ID security questions.
    An alternative to using the security questions is to use 2-step verification:
    Two-step verification FAQ Get answers to frequently asked questions about two-step verification for Apple ID.

  • After installing Mountain Lion.  Under sound, where it says select an output device, it say no output devices found and there is no sound.  How do I fix this?  I have reinstalled the os twice and still the same.  I have also repaired permissions.

    After installing Mountain Lion.  No sound. Under sound, where it says select an output device, it says no output devices found, and there is no sound.  How do I fix this?  I have reinstalled the os twice and still the same.  I have also repaired permissions.

    Try resetting the PRAM and SMC...
    PRAM Reset:
    http://support.apple.com/kb/HT1379
    SMC Reset:
    http://support.apple.com/kb/HT3964
    Hope this helps!

  • I can't remember the security questions and recovery email has been shutdown. How can I get back to purchasing songs, apps, etc.?

    I don't remember the security questions and my recovery email has been shut down after years of no activity. What can I do to get back to purchasing music, apps, etc.?

    The Three Best Alternatives for Security Questions and Rescue Mail
        1. Use Apple's Express Lane.
              Go to https://expresslane.apple.com ; click 'See all products and services' at the
              bottom of the page. In the next page click 'More Products and Services, then
              'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
              ID security questions' and click 'Continue'. Please be patient waiting for the return
              phone call. It will come in time depending on how heavily the servers are being hit.
         2.  Call Apple Support in your country: Customer Service: Contact Apple support.
         3.  Rescue email address and how to reset Apple ID security questions.
    A substitute for using the security questions is to use 2-step verification:
    Two-step verification FAQ Get answers to frequently asked questions about two-step verification for Apple ID.

  • I purchased my imac in the United States and now I live in the United Kingdom. How do I set the computer to know where we live as it defaults to US settings and I am having trouble registering my iphone

    I purchased my imac in the United States and now I live in the United Kingdom. How do I set the computer to know where we live as it defaults to US settings and I am having trouble registering my iphone. I had used it in the US for two years.

    You're Welcome..
    See Here for
    Changing Account Information
    http://support.apple.com/kb/HT1918
    Changing iTunes Store Account
    http://support.apple.com/kb/HT1311
    Apple ID FAQ
    http://support.apple.com/kb/HE37

Maybe you are looking for

  • How do I add gift cards to my account?

    How do I post a gift card to my account?

  • ERROR: DW050:  - Acrobat Professional : Install failed (CS6 design

    ERROR: DW050:  - Acrobat Professional : Install failed (CS6 design & web Premium) win7 64bits ***************************************error message after installation failure*************************** Exit Code: 6 Please see specific errors and warni

  • Hide show sections in pdf

    I have a form which is quite long and not all fields are needed for all the users who review the form. I am pretty new to Acrobat and have no programming knowledge - however, I was wondering if there is a tutorial that I can use to learn how to hide

  • Small table with many histograms

    In 10gR2 EE I took Oracle's default's when executing exec DBMS_STATS.GATHER_SCHEMA_STATS('xxxx'); One small table has 748 rows with 12 columns. View DBA_TAB_HISTOGRAMS shows 352 rows for the table. The space used in the data dictionary for this table

  • How to overcome corrupt redo log block header

    friends, can you tell me any utilities or packages using which i can clean my redo log . Iam encountering this error during recovery of my database Nand