Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Struts How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST

Have Programming Question? Ask it here!
 
 
 


ashutosh singh
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST
0 Answer(s)      2 years and 9 months ago
Posted in : Struts


In this code how i will use arraylist(which store all my records in index form) to show next data on button click,so that it will goes to next list and sees the index and display another records Please reply.

</tr>
           <%if (pageName.equals("1")) {%>
           <tr>
               <td>
                  <div style="height: 600px;overflow: auto;" >
                   <table border="0" width="100%" align="left" height="100%">
                       <tr>
                           <td width="20%" bgcolor="silver"> </td>
                           <td width="30%" height="30px" valign="center" align="center" background="http://www.widescreenbackgrounds.net/wallpapers/countryside-landscapes-landscape-desktop-images-widescreen-wallpapers.jpg">
                                <%
                                      String CardTopicId = request.getParameter("cardtopicId");


                                      /*Getting Cards with the Particular TopicId*/
                                      int a=Integer.parseInt(CardTopicId);
                                      List list1 = getCards.getCardsQuestionByTopicId(a);

                                                   int Id1 = 0, count=1;
                                                   String answer = null, question = null;

                                                   Iterator iterator1 = list1.iterator();
                                                   if(iterator1.hasNext())
                                       {
                                                             Cards get1 = (Cards) iterator1.next();
                                                             Id1 = get1.getCardId();
                                                             question= get1.getQuestion();
                                                             answer = get1.getAnswer();

                                     /*Getting Card  with the particular TopicId Ends Here*/

                                      int cardTopicid=Integer.parseInt(CardTopicId);
                                      int cardid=Id1;

                                       /*Comparing  Card id with the Particular TopicId*/
                                      List list = getCards.getCardsByTopicIdandCardId(cardTopicid,cardid);
                                      if (list.size() == 0)
                                                 {
                             %>
                             <font size="9" color="red"><br><br><br><br>      Sorry!No Question to view.</font>
                             <%                  }
                                                  else
                                           {
                                                     int Id = 0;
                                                   Iterator iterator = list.iterator();
                                                   if (iterator.hasNext())
                                       {
                                                             Cards get = (Cards) iterator.next();
                                                             Id = get.getCardId();
                                                             question= get.getQuestion();
                                                             answer = get.getAnswer();



                                       /*Comparing  Card id with the Particular TopicId Ends Here*/

                              %>


                              <h1>   <a href="flashPage.do?tid=<%=Id%>&pageName=2"><%=Id%><%=question%></a></h1>
                              <a href="flashPage.do?cardid=<%=++Id1%>&pageName=1&cardtopicId=<%=CardTopicId%>">  <img src="images/next1.jpeg" width="90" height="30"/>
                              </a>

                            <% count++;  }  
                                                }
                                       }
                            %>


                             </td>
                            <td width="20%" bgcolor="silver">
                                 
                            </td>
                       </tr>
                   </table>
                  </div>
               </td>
           </tr>


                                            <% } else if(pageName.equals("2")) { %>
          <tr>
               <td>
                  <div style="height:600px;overflow: auto;" >
                   <table border="0" width="100%" align="left"  heighT="100%">
                       <tr>
                           <td width="20%" bgcolor="silver"> </td>
                           <td width="30%" height="30px" valign="center" align="center"  background="">
                                <%
                                     String vid = request.getParameter("tid");

                                                      int id=Integer.parseInt(vid);
                                                     List list = getCards.getCardsCardid(id);
                                                     int Id = 0, count=1;
                                                     String answer = null, question = null;

                                                     Iterator iterator = list.iterator();
                                                      while (iterator.hasNext())
                                       {
                                                             Cards get = (Cards) iterator.next();
                                                             Id = get.getCardId();
                                                            question= get.getQuestion();
                                                             answer = get.getAnswer();
                              %>

                              <h1>
                              <font color="#00FF00" size="+5">
                                 <font color="blue">  </font><%=answer%></font></h1>
                                <a href="flashPage.do?tid=<%=Id+1%>&pageName=3" >  <img src="images/next1.jpeg" width="90" height="30"/>  </a>
                            <% count++; } %>
                            </td>
                            <td width="20%" bgcolor="silver">
                                 
                            </td>
                       </tr>
                   </table>
                  </div>
               </td>
           </tr> 
            <% } else if(pageName.equals("3")) { %>
           <tr>
               <td>
                  <div style="height: 600px;overflow: auto;" >
                   <table border="2" width="100%" align="left" heighT="100%">
                       <tr>
                           <td width="20%" bgcolor="silver"> </td>
                           <td width="30%" height="30px" valign="center" align="center" background="">
                                <%
                                     String vid = request.getParameter("tid");

                                     String zid = request.getParameter("cardtopicId");

                                      int id=Integer.parseInt(vid);
                                        List list = getCards.getCardsCardid(id);

                                             if (list.size() == 0)
                                                 {
                                    %>
                                    <font size="9" color="red"><br><br><br><br>      Sorry!No Question to view.</font>
                                                <%} else
                                           {
                                                     int Id = 0, count=1;
                                                     String answer = null, question = null;

                                                     Iterator iterator = list.iterator();
                                                     if (iterator.hasNext())
                                       {
                                                             Cards get = (Cards) iterator.next();
                                                             Id = get.getCardId();
                                                            question= get.getQuestion();
                                                             answer = get.getAnswer();
                              %>

                              <h1>   <a href="flashPage.do?tid=<%=Id%>&pageName=2"><%=question%></a></h1>
                              <a href="flashPage.do?tid=<%=Id+1%>&pageName=3&cardtopicId=<%=zid%>" >  <img src="images/next1.jpeg" width="90" height="30"/><h1> </h1> </a>
                            <% count++;  }
                                       } %>
                             </td>
                            <td width="20%" bgcolor="silver">
                                 
                            </td>
                       </tr>
                   </table>
                  </div>
               </td>
           </tr>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST  How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST,please send answer as soo as possible
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST  In this code how i will use arraylist(which store all my records in index form) to show next data on button click,so that it will goes
Advertisements
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST  In this code how i will use arraylist(which store all my records in index form) to show next data on button click,so that it will goes
How to show next question from database on the click of next button..(Struts & Hibernate)
How to show next question from database on the click of next button..(Struts.... Problem.: When m clicking my next button it is not showing another question from "cards" table. passing parameter from viewalllists.jsp to flashPage.jsp
How to show next question from database on the click of next button..(Struts & Hibernate)
How to show next question from database on the click of next button..(Struts.... Problem.: When m clicking my next button it is not showing another question from "cards" table. passing parameter from viewalllists.jsp to flashPage.jsp
change database values when click next button on jsp page
change database values when click next button on jsp page  How to retrive database values rondomly and display jsp page ,when user click next and previous bottons change the values on jsp page
How to Display Next question from database after clicking Next Button using "Arraylist concept"
How to Display Next question from database after clicking Next Button using "Arraylist concept"  </tr> <%if (pageName.equals("1")) {%> <tr> <td> <div style
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript  when click on the next button/link then it must display next 10 record from database and same for previous
How to use next and previous button(or href) for database table that is retrieved from MySQL DB.
How to use next and previous button(or href) for database table that is retrieved from MySQL DB.  Initially,display 7or10 records on a jsp pageand when click on the NEXT button(or href link) then display next 7 records
how to display a table from database using servlet
how to display a table from database using servlet  how to display a table with values from servletpage   Hi Friend, Please go through the following link: http://roseindia.net/jsp/servlet-jsp-data-list.shtml Thanks
Acess Record from database.
Acess Record from database.  How to access records from database and how to display it on view page, with the help of hibernate
how to display records from database
how to display records from database  I want to display records from database in tables, the database is having 2000 records and i want to display 20... as like next button using classic asp i need codes for the above said process
how to display values from database into table using jsp
how to display values from database into table using jsp  I want to display values from database into table based on condition in query, how... the values from database based on the bookname or authorname entered must be display
to display single row from database and next to display other question - JSP-Servlet
to display single row from database and next to display other question ... questions in database we have to display first question on clicking the button it has to display the next question. i tried it first question is displayed
fetch record from oracle database using jsp-servlet?
fetch record from oracle database using jsp-servlet?  how can i fetch data from oracle database by using jsp-servlet. i'm using eclipse, tomcat server and oracle database and creating jsp pages and also using servlet
How to retrive a particular record from database in php with mysql?
How to retrive a particular record from database in php with mysql?  Am using phpMyAdmin Database.In mysql database having 10 records. The field... record based on username and password. I dont know how to retrive in php with mysql
next and previous record in php
next and previous record in php  How to display next and previous records in PHP
how to display data from database in jsp
how to display data from database in jsp  how to display data from database in jsp
How i upload file and save that record in database using JSP?
How i upload file and save that record in database using JSP?  Hi All, I m the beginner in JSP and I want to upload the file and store that file and some other form data in MySQL database. Ex. There is one employee detail form
retrieve data from database in java swing form using prev n next buttons
retrieve data from database in java swing form using prev n next buttons ... of various rows from database in labels by clicking previous and next buttons.also first record should be visible as soon as the window opens n previous button
retrieve data from database in java swing form using prev n next buttons
retrieve data from database in java swing form using prev n next buttons ... of various rows from database in labels by clicking previous and next buttons.also first record should be visible as soon as the window opens n previous button
How to display data from database in a TableView
How to display data from database in a TableView  I need to populate a TableView (JavaFx) with database items. I designed the TableView in JavaFx... at this. The classes: This is the Class that creates the database data object: import
how to display data from jsp file into database
how to display data from jsp file into database  this is a jsp file...(); in the below example. the error is "cannot convert from java.sql.Statement...+",'"+email+"')"); out.println("Data is successfully inserted into database
How to retrieve record from table
How to retrieve record from table  Hi. I have a field in database...,kanchipuram for a single record. I have to retrieve these data from the field table.... how to do
How to display nested ArrayList in JSF
How to display nested ArrayList in JSF  I have a class... to display it in jsf but i dont know how and i am getting mad. I have nested... very well how it works. Please, I need help. Thank you very much
how to fetch the record using AJAX? - Ajax
how to fetch the record using AJAX?  Can anyone tell me how to fetch the records from database using Ajax
How to solve concurrency issue when an application is running on two machine to fetch record from one database
How to solve concurrency issue when an application is running on two machine to fetch record from one database  I have developed an application in java to run on two machines. Program will fetch a record from database and process
JSP Delete Record From Table Using MySQL
JSP Delete Record From Table Using MySQL This tutorial explains you that how to write a JSP for deleting a record from database table. In this section you.... In this tutorial you will learn that how to delete a record of a database table in JSP
Retrive values from an arraylist and display in a jsp?
Retrive values from an arraylist and display in a jsp?  Hi, I need help in jsp to display values of an ArrayList in jsp. There is a java file containing a method which is returning an ArrayList. I want to display the records
retrive record from the text field and insert into to database
retrive record from the text field and insert into to database  the following code is inserting values in the my sql database but i want to insert the data into oracle database , i want what changes i have to make
Retrive values from an arraylist and display in a jsp?
Retrive values from an arraylist and display in a jsp?  Hi, I need help in jsp to display values of an ArrayList in jsp. There is a java file containing a method which is returning an ArrayList. I want to display the records
how to display data into textboxes which is retrieved from the database
how to display data into textboxes which is retrieved from the database  I would like to know how to display data into textboxes which is retrieved from database in jsf. could you please provide a small example of how to do
how to display data into textboxes which is retrieved from the database
how to display data into textboxes which is retrieved from the database  I would like to know how to display data into textboxes which is retrieved from database in jsf. could you please provide a small example of how to do
how to display data into textboxes which is retrieved from the database
how to display data into textboxes which is retrieved from the database  I would like to know how to display data into textboxes which is retrieved from database in jsf. could you please provide a small example of how to do
how to display image and text in single jsp page from the mysql database
how to display image and text in single jsp page from the mysql database  hello please help me to display the image and text in single jsp page from mysql database if have any reference code please send me Thanks in advance
how to display each arraylist value on new page in jsp
how to display each arraylist value on new page in jsp  hi!!!! i want to display each arraylist value on new page in jsp????? and also want to access the arraylist values using next button..... any help would be appreciated
Loading a jsp page (with record from database) from another jsp page
Loading a jsp page (with record from database) from another jsp page  ... in Search.jsp say Serial no,year and a button VIEW DATA. I want, when I click... with records from database(against Serial no and year).That is, as soon
how to record qvga video using j2me - Applet
how to record qvga video using j2me  hello if it is possible how i can record qvga video usin j2me
how to write a program to search a record using mvc2
how to write a program to search a record using mvc2   how can we write a code to search a record in table by using java bean as model, servlet as contoller and jsp as view
How to display data in jsp from dao using java beans?
How to display data in jsp from dao using java beans?  Hi I need to display data in jsp pulling from dao using java beans, Please can anyone give me the sample application with above topics. Any help would be highly appreciated
How to display data from database in a TableView via Hibernate
How to display data from database in a TableView via Hibernate  I need to populate a TableView (JavaFx) with database items. I designed the TableView... at this. The classes: This is the Class that creates the database data object
How to delete the row from the Database by using servlet
How to delete the row from the Database by using servlet  Dear Sir...: Delete row from database using servlet   In that link solution... then the user data to be delete from the database table. Assume in Database table have
how to display data from database according to entered value in search field
how to display data from database according to entered value in search...(); System.out.println("Disconnected from database"); } catch (Exception e...;/html> this is my searchview2.jsp file where it display the result <
how to search the string arraylist contains database rows?
how to search the string arraylist contains database rows?  i need to search 2 database. one is excel database and another is SQL database. stored the row values into string arraylist. now i want to print the common rows existed
Display Data from Database in JSP
;To display all the data from the table click here...</h2></TD>..., to show data from the database click on the link that calls another .jsp file named...;title>display data from the table using jsp</title> </head> <
how to record qvga video using j2me - Applet
how to record qvga video using j2me  hello if it is possible how i can record qvga video usin j2me?   Hi Friend, Please visit the following links: http://www.roseindia.net/j2me/video-midlet.shtml http
Fetched Record from database show into text field of html page
Fetched Record from database show into text field of html page  hi, i have a database with field merchant_code, merchant_name, city, region, and also have html page with all above mentioned field i have submit 20 record from
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
 

 

 

DMCA.com