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



Home Answers Viewqa Struts How to Display Next question from database after clicking Next Button using "Arraylist concept"
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ashutosh singh
How to Display Next question from database after clicking Next Button using "Arraylist concept"
0 Answer(s)      3 years and a month ago
Posted in : Struts


</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">&nbsp;</td>
                       <td width="30%" height="30px" valign="center" align="center" background="http://www.widescreenbackgrounds.net/s/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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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> &nbsp;&nbsp;<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">
                            &nbsp;
                        </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">&nbsp;</td>
                       <td width="30%" height="30px" valign="center" align="center"  background="http://www.bestclipart.net/wp-content/uploads/2011/09/Background-Images-3.jpg">
                            <%
                                 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">&nbsp;&nbsp;</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">
                            &nbsp;
                        </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">&nbsp;</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 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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> &nbsp;&nbsp;<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">
                            &nbsp;
                        </td>
                   </tr>
               </table>
              </div>
           </td>
       </tr>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
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... = null, question = null; Iterator
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
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 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
to display single row from database and next to display other question - JSP-Servlet
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...to display single row from database and next to display other question 
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 make previous and next Button Display Data in php
how to make previous and next Button Display Data in php  <?php...); extract($_SESSION); /*$rs=mysql_query("select * from mst_question where test_id=$tid...;/p> $query="select * from mst_question"; $rs=mysqlquery("select * from
to display NEXT and previous option after 10 entries in java
to display NEXT and previous option after 10 entries in java  As after jsp code we refer to java for connectivity and i want that directly only 10... options without any table and all. just we have to take query from the database
please give me solution how to display next page after 20 records ? - JSP-Servlet
please give me solution how to display next page after 20 records ?  ...; if(row==4){ document.links("next"+document.request.preRow.value).disabled... previous next 11 12 13 14 15
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
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  i have a database having columns id(int),path(text),width(int),height(int... of various rows from database in labels by clicking previous and next
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  i have a database having columns id(int),path(text),width(int),height(int... of various rows from database in labels by clicking previous and next
next button in servlet
next button in servlet  i want to add next,previous button to get next record in my servlet. can you explain the logic to do
display all the values on next page
display all the values on next page  i am inserting values in the database through textboxes and dropboxes, when i am clicking on submit button those values are inserting in the database and i am moving on another page after
pass radio button values to next page
pass radio button values to next page  how to pass selected radio button values which coming from mysql database to next page using php. Please show me with examples
automatically move next page when data fetched from database is stored in text field
from database and entered the next page should load without the user clicking on enter button. pls suggest me how to move next page without user clicking...automatically move next page when data fetched from database is stored in text
How to load elements from db when i press next.
How to load elements from db when i press next.  Hello , I am working on a project "Online Book Mart" using JSP and Servlets and I am astuck... means when i click next, the next 20 books will be displayed from db on the same
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 show multiple identicle rows from database on clicking search button to jtable
How to show multiple identicle rows from database on clicking search button...); } } }); } }   Here is a code that search the data from the database and show multiple identical rows from database on clicking search button
How to show multiple identicle rows from database on clicking search button to jtable
How to show multiple identicle rows from database on clicking search button...); } } }); } }   Here is a code that search the data from the database and show multiple identical rows from database on clicking search button
How to show multiple identicle rows from database on clicking search button to jtable
How to show multiple identicle rows from database on clicking search button...); } } }); } }   Here is a code that search the data from the database and show multiple identical rows from database on clicking search button
Should not logout after clicking the back/forward button
Should not logout after clicking the back/forward button  Hi all I... he clicks on the back button user automatically gets logged out. very next if clicked the forward button user gets logged in..!! how can I solve this issue? What
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
how to display the values of one list in other upon clicking a button in struts2
how to display the values of one list in other upon clicking a button... in struts2.. I have a problem, I have to display the values of one list in other list upon clicking a button...Can any one provide me the sample code.. Hope
How to prevent from navigating to a page after reaching Login page using back button?
How to prevent from navigating to a page after reaching Login page using back... login page using back button and agin click browser forward button,the 2nd page session gets expired but on next click on forward button,the pdf document opens
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
in the below code two errors are there one at the button onclick atttibute and the next is at the next button
in the below code two errors are there one at the button onclick atttibute and the next is at the next button  <%@ page import="java.sql.*" %> function editRecord(id){ var f=document.form; f.method="post
how to get the next option - Java Beginners
how to get the next option  i was getting values from the database it was bulk so i want to keep the next option how to do in the jsp  ... by mistake. If you want to navigate the database data then you can visit
Advertisements
 

 

 

DMCA.com