Raghu
2008-06-27 18:43:48 UTC
Hi, I want to implement ajax pagination on my struts2 page but I am not sure
how to implement that. I am not very good in javascript and jquery but
learning them..
I have a table which will show 10 user comments at a time and there will be
pagination links for fetching next set of comments using Ajax using Jquery
$.getJSON( ) method.
I am using struts2 json plug in and it return json result. Now problem is
how to set this Json result to my struts2 tags on jsp page?
If anyone could help me on this problem then it will be great.
<table width= "500" border="0" cellspacing="0"
cellpadding="0">
<s:if test="article.comments.size > 0">
<s:iterator value="article.comments"
<tr>
<td width="50">
<a href="#" class="wname"> <s:property
value="userName"/> </a>
</td>
<td width="150">
posted on
<s:date name="commentDate"
format="dd-MMM-yyyy hh:mm aa" />
</td>
<td width="200">
</td>
</tr>
<tr >
<td colspan="3">
<s:property value="comments"/>
</td>
</tr>
</s:iterator>
<span id="comments-Pagination"> Pagination links
goes here.. </span>
</s:if>
<s:else>
No Comment Found.
</s:else>
</table>
Thanks
Raghu
how to implement that. I am not very good in javascript and jquery but
learning them..
I have a table which will show 10 user comments at a time and there will be
pagination links for fetching next set of comments using Ajax using Jquery
$.getJSON( ) method.
I am using struts2 json plug in and it return json result. Now problem is
how to set this Json result to my struts2 tags on jsp page?
If anyone could help me on this problem then it will be great.
<table width= "500" border="0" cellspacing="0"
cellpadding="0">
<s:if test="article.comments.size > 0">
<s:iterator value="article.comments"
<tr>
<td width="50">
<a href="#" class="wname"> <s:property
value="userName"/> </a>
</td>
<td width="150">
posted on
<s:date name="commentDate"
format="dd-MMM-yyyy hh:mm aa" />
</td>
<td width="200">
</td>
</tr>
<tr >
<td colspan="3">
<s:property value="comments"/>
</td>
</tr>
</s:iterator>
<span id="comments-Pagination"> Pagination links
goes here.. </span>
</s:if>
<s:else>
No Comment Found.
</s:else>
</table>
Thanks
Raghu