Sunday, May 1, 2011

problem in implementing dynamic pagesize in pagination strut2 + java

hi i am try to implement pagination through display tag in strut2 now my requirement is i have a combo box which has some page size value like 5, 10, 15 .. so how can i update that value in page size of display tag in strut2

thank in advance regards lakhaman odedra

From stackoverflow
  • I'm not sure about struts2 in particular, but with JSF in general, if you bind whatever component you use to paginate into your backing bean, you can set properties such as that through an action.

  • You would create an exposed property on your action, named for example selectedPageSize. This property could be set to a default size (in your example 5). You would keep a hidden form field storing the currently selected value. This would then be used in your view with the display tag similar to:

    <c:set name="selectedPageSize" value="selectedPageSize" scope="request"/>
    <display:table pagesize="${selectedPageSize}" ... >
    
    lakhaman : but how can we set this expose property from hidden field . can you please guide me some statement and how we create expose property in action class
    lakhaman : thanks rich kroll for your help

0 comments:

Post a Comment