AdvancePageTableModel and pageSize

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

AdvancePageTableModel and pageSize

Postby XDMJ » Fri Feb 13, 2015 3:47 am

Hi,

we are using AdvancePageTableModel and having issues with pageSize.
When using protected AdvancePageTableModel(int pageSize) pageSize seems to be always 25, whatever pageSize specified in the constructor.
Is there a limition on the implementation that prevents from using pageSize ?

Best regards
XDMJ
 
Posts: 3
Joined: Wed Feb 15, 2012 9:24 am

Re: AdvancePageTableModel and pageSize

Postby JIDE Support » Fri Feb 13, 2015 7:49 am

I checked the code and the page size you passed in the constructor is indeed used. I searched the code and didn't see anywhere we ever hard coded 25. Could it because something else in your code?
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: AdvancePageTableModel and pageSize

Postby XDMJ » Fri Feb 13, 2015 8:16 am

Thanks for the reply

After some investigation, it seems that connecting the PageNavigationBar resets the pageSize on the PageNavigationSupport model to 25 ...
This is how we create the PageNavigationBar :

Code: Select all
PageNavigationBar pageNavigationBar = new PageNavigationBar(table);



A workaround is to set the pageSize right after but this generates 2 'refresh' on the model, one with 25 elements, the other with pageSize specified which is quite bad.

Hope this helps
XDMJ
 
Posts: 3
Joined: Wed Feb 15, 2012 9:24 am

Re: AdvancePageTableModel and pageSize

Postby JIDE Support » Fri Feb 13, 2015 8:30 am

I see. That page size was calculated from the table viewport height. I think we would rather keeping it.

Code: Select all
        int pageSize = table.getPreferredScrollableViewportSize().height / table.getRowHeight();
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: AdvancePageTableModel and pageSize

Postby XDMJ » Fri Feb 13, 2015 8:34 am

Thanks.

Is there a way to set it manually instead of being calculated ?
XDMJ
 
Posts: 3
Joined: Wed Feb 15, 2012 9:24 am

Re: AdvancePageTableModel and pageSize

Postby JIDE Support » Fri Feb 13, 2015 9:34 am

Right now there is no way to not set the page size. I will try to come up with something so that if you set your own page size, we will not mess up with it. Will keep you posted.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 14 guests