File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 + Hibernate + paging

 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends i want to create paging with help of Struts2 + Hibernate please help me if any one know ....

Thanks,
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can go ahead using display tag for it.
 
hung kin
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand you. you can say careful....
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a project called Display Tag.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,


You can refer this link for more detail.

http://displaytag.sourceforge.net/11/


Thanks,
Nishan Patel.
Java Developer.
 
hung kin
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
I user DisplayTag page 1-ok but it not display page 2,3 =>no data
???
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Nishan: not sure how that link provides any more detail than mine, since they're the same link.

@Hung: You'll need to look at the display tag docs or ask on a display tag forum/list, it's not really a Struts question.
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all, Struts 2 is a very rich framework and you will enjoy working on it.. and nishan if you are serious using display tag we can further discuss if you are stuck...

happy developing...
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Thanks all of you,

But i want to know can I use Struts tag in display tag.

Because i am not getting value while I use Struts tag in display tag.



Thanks,
Nishan Patel
Java Developer
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because i am not getting value while I use Struts tag in display tag.

That it actually not enough information to help.

It might make sense to post some example code that isn't working--how else will we be able to figure out what might be wrong?!

http://faq.javaranch.com/java/TellTheDetails
[ November 21, 2008: Message edited by: David Newton ]
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes nishan you can always use struts2 tag inside display tag and vice versa... but i agree with david... you can leave us a bit of code there to make us motivated


happy developing
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,


This is my code.
Can i use this. ?

<display:column headerClass="Table-Head" title="Status">
<input type="checkbox" id="active"
name="active" value="<s roperty value="id" /> />
<input type="hidden" name="checkedId" value="<s roperty value="id" />">
</display:column>
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello David,

See, now i put my code. Now, tell me it is working or not ?
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi nishan... you are using basic input tag to have a checkbox, however struts2 gives a wonderful utility to have checkbox in your page.
you can have a checkbox by using s:checkbox

for ex:

<display:column title="" >
<s:hidden name="YourList[%{#attr.row_rowNum - 1}].YourID" value="%{#attr.row.YourId}"/>
<s:checkbox name="select[%{#attr.row_rowNum - 1}]"
value="select[%{#attr.row_rowNum - 1}]" />
</display:column>

attr.tableId_rowNum is pure display tag feature to give you the row number and you can use it for indexing your rows... where "attr" is of display tag "tableId" is your tables id, and "rowNum" again is of display tag. "-1" is to start the first row or the header to be counted that display tag adds p to your list. hope you know the Ognl expressions used in this.


Happy developing...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See, now i put my code. Now, tell me it is working or not ?

How would I know if your code is working or not?
 
sanjiv tuli
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nishan

Hope you solved your problem by comments posted above, i have just read this thread and i searched good link which has the solution of your problem with running application

http://javateacher.co.in/misc-frameworks/struts-2-x/struts2-pagination-using-display-tag/


Hoping it will help you


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic