Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

want to show only rows in dispaly tag in struts page using pagination

 
vishal gaiky
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends,

i am developing one online exam application using struts i want to use pagination to show five pages and on each page i want to show 5 questions..now problem is that i am using display tag but i dont know how to iterate it for rows only..i want to show data on rows not on columns like

1. question text.
radio button 1
radio button 2
radio button 3
radio button 4

2. question text.
radio button 1
radio button 2
radio button 3
radio button 4

3. question text.
radio button 1
radio button 2
radio button 3
radio button 4


like above
 
vishal gaiky
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me friends..
 
Daniel Val
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vishal gaiky wrote:hello friends,

i am developing one online exam application using struts i want to use pagination to show five pages and on each page i want to show 5 questions..now problem is that i am using display tag but i dont know how to iterate it for rows only..i want to show data on rows not on columns like

1. question text.
radio button 1
radio button 2
radio button 3
radio button 4

2. question text.
radio button 1
radio button 2
radio button 3
radio button 4

3. question text.
radio button 1
radio button 2
radio button 3
radio button 4


like above


Probably you iterate something like
<logic:iterate>
<html:radio .... /> <br/>
</logic:iterate>

And that is the reason it starts on the next line. Remove the BR tag and the radio buttons will be displayed horizontally.

If your question was not that but you actually wanted the first question and group shown in a position, then the second one together with its options shown to the right, then you need a layout table. You render a table tag,
then a tr tag, then the first question and options will be in the first td tag, the second and its options in the second td tag etc.

<table>
<tr>
<td>
Question 1 <br/>
radio 1 <br/>
radio 2
</td>
<td>
Question 2 <br/>
radio 1 <br/>
radio 2
</td>
</tr>
</table>

and this will be rendered horizontally, question by question.
 
vishal gaiky
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to use pagination also so i cant use other tag than display tag..i want pagination + radio button to options
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic