By refreshing the button how to get the latest records from database byu using ajax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nivetha
    New Member
    • Jun 2007
    • 12

    By refreshing the button how to get the latest records from database byu using ajax

    I have requirement list of records are there in that each and every record i need to keep refresh button by clicking that each button ....it should take tha latest value from the database that too it should fetch individual column
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Show some code.

    For each button, call a generic piece of Javascript code which will take the row/column no. (or whatever can identify the piece of information that you need) and make an Ajax request. Using the response, it should be easy to update.

    How this could be done will be more clear if you post some code.

    Comment

    • Nivetha
      New Member
      • Jun 2007
      • 12

      #3
      i have a for loop through which i am able to populate my database contents and display the results on individual rows of my table.

      Now i want to refresh a particular row and not the entire table.I am giving a refresh button to each row ,onclick of which i want to refresh that particular row.

      Is this posible in Ajax keeping in consideration that the all my rows are lying within the " for loop".

      Thanks in Advance.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Yes, it should be possible as long as you have the relevant code on the server side and you call it with the correct parameters. For example, the rowid could be a unique identifier for a record in the database which corresponds to the row that you're trying to refresh. If you pass that along to the script and the server-side script returns one row, you can use that to update the row.

        Post your code.

        Comment

        • Nivetha
          New Member
          • Jun 2007
          • 12

          #5
          i have a unique row id in my table but my only concern is how to get that in jsp page bcoz each record it should take latest value not for the whole table and also i never used ajax ..can u give some example for this scenario..

          Thanks in Advance

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Check out the tutorials in the Offsite Links thread. They contain plenty of examples. If the unique rowid corresponds to the id in the table then the JSP code should be easy. As far as AJAX is concerned, see the examples and tutorials. If you get stuck, post your code here.

            Comment

            Working...