• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem w/Data Table model

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using an HTMLDataTable as the model for my h:datatable on the frontend. I have implemented a selectManyListBox search functionality where as soon as the user clicks an item in any of the lists, the form is submitted, and only those rows which fit the selected criteria are shown. This is effectively a filter search.

The problem comes in when I have a datatable w/say 50 elements, and the size of my datatable is 20 elements. So when you click the ">" button, it goes to the last page.

Now I add a criteria selection, and now the amount of elements in the datatable is 18. Now there it can all fit in one page, but the datatable model needs to be set back to the first page. I am not sure how to do this... should I clarify?

Thanks,
Ayan
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Set the property of h:datatable

first="#{LoginManager.offset}"

Here LoginManager is my BackingBean and offset is integer variable with zero value.

I think this will solve the problem.
 
I guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic