Out of the box behavior of the Pagination control
Why does the Pagination invoke the PageFactory callback upon page count change? And when it does invoke it, why is it with currentPageIndex=0? Should there be an API to remove this listener if this is undesirable behavior? If we know we may need to alter the Page Count after construction of the Pagination control, would it be best to remove the old one, and construct a new one for display at that point since the current implementation seems to behave inconsistently when one wants to alter the Page Count post-construction and/or callback configuration.
Please consider the following scenario:
The user is viewing a TableView of items. Below the TableView is a Paginator whose PageFactory callback fetches rows from a database and calls TableView.setItems(<results>). There are 3 pages and the user is on the 3rd page. Only 5 rows remain out of a possible page size of 20. The user decides to delete the 5 remaining rows on page 3 from the table/database. Now it would seem natural at this point to conclude that page 3 no longer exists and we would want to the user to return to page 2. If we simply call paginator.setCurrentPageIndex(currentIndex - 1) then we will correctly transition the user to Page 2, however Page 3 will remain displayed in the Pagination control and if the user browses back to that page, he is met with the "There is no content to display" label. So it would seem natural that we could presume this happening and instead call paginator.setPageCount(2), then paginator.setCurrentPageIndex(currentIndex - 1). That way the Pagination control reflects an accurate number of pages. Unfortunately, this results in TWO callbacks to the PageFactory method, one at currentPageIndex=0 and another at the correct index. Sometimes the widget that is constructed in the PageFactory callback (TableView) doesn't get displayed properly (disclaimer: speculation ahead) probably due to some asynchronous nature of the two competing callbacks (?).
I'm struggling to get a handle on this control. So far, my experience with TableView has been pretty good. I love the features you get with this Pagination control out of the box, but some of the choices that were made with regards with what APIs to expose confuse me. The frustrating thing about callbacks is that sometimes you can get caught in this callback hell where there are all sorts of callbacks being invoked and you don't really know why. Often times, the Javadoc does not indicate that there is a default listener being applied to certain property that may invoke one of these callback. I don't mean to sound like a rant. Overall my experience with JavaFX 8 has been very positive so far. I can usually always find a workaround if a come across a weird issue with an out of the box control. Worst comes to worst, I'll write my own Pagination control.
Thanks for your time.
For anyone else that may come across this post. I was able to find a workaround by simply using a field, boolean pageCountReset, and then bounding all of the logic in my page factory call back with a condition checking for this boolean value i.e. if (!pageCountReset) // continue, else // noop. Then, if I need to reset the page count, I set my boolean to true so that the page factory callback results in a noop. Because the pagination control under the hood will make currentPageIndex=0 (as I talked about above) if the page count is reset, I then have to be very explicit and either call my page factory callback manually to refresh the current page if it still valid, or I call pagination.setCurrentPageIndex(<new index>) so that the page factory callback will be invoked and pageCountReset will be false at this point, so I can successfully transition pages.
Similar Messages
-
Tried purchasing music from the iTunes Store. When the window popped up I put in my apple id and password. Then I was directed to a 'Terms and Conditions' page. I checked the box next to the 'Yes I agree to these terms and conditions' - then clicked the 'accept' button next page read 'Your Session has timed out. Try again.' with a 'Done' button to click on. Oh the same thing happens when i try to download free iTunes. Yes I have tried & tried it again I even logged off and singed back in-- no joy
After accessing my iTunes account I was not able to change anything like my credit card number when I tried and was sent right to the 'Your session has timed out. Try again.'
The last time I purchased any anything was on September 25th 2011 and the 'terms & conditions' page was last updated on October 12, 2011
Does anyone have an idea to what is going on with my iTunes version 9.2.1 (5) and I can not upgrade to a higher version my iMac does not have the intel processor chip.Thank you for your time and help with this matter. You are greatly appreciatedI am having the same problem also! I posted on here about it, but no one has responded with ideas. I called technical support and e-mailed them, the only suggestions they gave was for the to turn off my firewall. But I didn't change anything, so it shouldn't suddenly stop working. Maybe this is just an iTunes issue? But it doesn't even recognize my account anymore, and I cannot log in now.
If you happen to get an answer, will you please let me know what works for you?
Thanks! -
Just started up my Mac Mini out of the box, using a USB windows keyboard, it will not recognize letters so I am unable to enter serial number. Anything I can do to get the mini mac right out of the box to recognize the windows keyboard? Do I have to buy an Apple Keyboard to get it to work right out of the box?
Is this a normal USB keyboard or is there anything specialized about it? Does this keyboard require you to install any special software to use it on a Windows box? Or is it usually a plug & play keyboard?
Normally if a Mac does not recognize a keyboard it asks you to press certain keys to identify the keyboard. What is happening on screen with this keyboard? What serial number are you referring to? -
Since downloading Firefox 4, I am having problems archiving gmail conversations from my inbox view (either one or several conversations) as it says "No Conversations Selected" when I have selected one or several. Also, when I go to enter a new event in google calendar, I have to click the cursor in the box to type the event (it used to let me just start typing) or else it flips out and starts jumping to day view or another month. Does anyone know how to fix either of these?
I have had this problem; but while trying to fix another problem, I reset my preferences for Firefox and it fixed this problem as well. To reset preferences, follow this link: http://support.mozilla.com/en-US/kb/Resetting%20preferences
-
How to update the BOX version of the Logic Pro 9 in Mountain Lion??
Hi!
How to update the BOX version of the Logic Pro 9 in Mountain Lion?
For example, if tomorrow will be new updates for Logic Pro for exapmle 9.1.8. (now I have 9.1.7) Will I not able to get it?? Now should I buy the second Logic pro??
Recently I have got answer from App Store support:
"Max, since you have not purchased the app in the App Store, you can't get updates directly in App Store. In this case, you will need to purchase the updated version in the App Store so you can get further updates."
It's... I bought Logic Pro 9 + MainStage + + +++ .... in the Apple Retail Store and what now?? Updates works perfect in Snow Leopard.
I can't understand...
Can you help me please? =)Max,
Rest assurred, you will get updates via the App store. What will happen is when you install the box version, the Mac App Store will ping when there is an update to download(for free), much like any other Apple app(Garageband, iWork, etc) regardless of where you bought it from. If it's installed, it will check for updates.
If the Mac App store doesn't show an update that you know is out, simply down it directly from support.apple.com and apply it.
Hope this helps. If so, LIKE the post.
Glenn -
I purchased Photoshop cs5 a while back in disk form for my old imac. Now my new laptop doesnt have a disc drive... can I get the program onto my new computer? I don't have the box, but have the old computer it's on...
also had a friend place inD and Ai on my old laptop and am curious to know how to get it to my new oneAs long as you have your serial number, you may download and install
OLDER previous versions http://www.adobe.com/downloads/other-downloads.html -
HI, My Macbook Air was stolen this week from my checked baggage.
I have the box with all the information SN etc.. Is there a way to disable this device? Block it from my Yahoo email? Locate it? Any ideas?If you activated "Find My Mac" in iCloud before the loss, maybe. Otherwise no.
-
I have bought photoshop elemnts 12 and have a CD, but there where no serialnumber in the box or on the folder. What shall I do to activate. Have tried to search a support number in Sweden but i can´t find any.
Find your serial number quickly
Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html -
have Mozilla Firefox as my browser vs Internet explorer. This morning when I tried to open Mozilla after several attempts it said it had crashed with a window that I could check the box to send the report to Mozilla but it wont even let me send the report I can get on the internet with explorer but dont want to go back to that so would I just delete mozzila and start all over or will that not clear up the problem? Im lost help
Have you tried any of the solutions in [[Firefox crashes when you open it]]?
-
I check the box to "Remember the password for sites" and the check keeps disappearing.
I check the box to "Remember the password for sites" and the check keeps disappearing. Each time I open the Security page in Options the check box is clear. I'd like it to stay checked.
See:
* http://kb.mozillazine.org/Preferences_not_saved
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
* Don't make any changes on the Safe mode start window.
* https://support.mozilla.com/kb/Safe+Mode
* https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes -
Hi, I bought a İphone 4, it asks activation İcloud but I do not know login & password, but the box and all the codes (IMEI 013126007351651,ICCID 8999404110643086147) available. What to do?
If you bought the phone used then you will need to contact the previous owner - only the owner of an account can remove a device from their account (neither Apple, nor fellow users here on these forums, can do it) : http://support.apple.com/kb/TS4515
-
Greetings. Please tell me how much weight iPhone 4s in the box with all the accessories? I am interested in the weight of the smartphone box booklets all the accessories. Thank you. (American adapter.)
I would google the question there doesn't seem to be any agreed weight and you will find plenty of answers all conflicting
Clearly no-one is coming up with an solution here -
There's no clip in the box to get the sim card holder out!
when i open the box, but didn't find the the clip.
i think there should be a clip right?
if no, how can i get the sim card holder out?Nope, it clearly shows in Apple's that no SIM tre oval tool is included.
http://store.apple.com/us/buy-iphone/iphone6 -
How to remove out-of-the-box policy violation from Database Control
Hi, I just installed a new Oracle 11g box with a new database created using DBCA with all the out-of-box settings.
Using database control, I can see a lot of "policy violation" warning etcs. For example, one warning is "Control File Permission (Windows)". Apparently, it is complaining about the control file permission bit. So I go in and remove all permission except for systems and the oracle dba group ORA_DBA (in window). Still it is complaining. How do I fix it?
Thanks for any suggestionIt should disappear after you have "completely" taken care of it. If you think you have, then you can use "Manage Policy Violations" to ignore and clear them. But do not do this if you have not taken care of it.
-
I managed to 'untick' all the boxes next to the tracks, how do I undo it?
Hi
I've no idea how I did it but I managed to take out all the ticks in the little box next to the track names. Please can anyone tell me if there is a way to make them all selected again?
Thanks
AdamYou can find answers easily in itunes help sometimes.
iTunes > Help > Keyboard Shortcuts is very useful.
What you want to do is
Control-click the checkbox next to a song to select or deselect all the songs in a list (add or remove all checkboxes)
Maybe you are looking for
-
I have a Java/CVE-2010-94 virus on my macbook pro. Can Someone help me fix this?
I used Virus Barrier Express that I downloaded from the App Store and it found a virus named Java/CVE-2010-94. I ran Virus Barrier Express again after I prssed the "fixed it" button; however, i'm not sure if this virus or any other virus is still on
-
Dunning Wizard - Interest calculated
Hi Experts, The interest tjhat the dunning wizard calculates on a specific BP, How does it get allocated to that BP balance? i.e does it automatically get added to the BP balance or do you need to go post it manually via journal entry or what? Thank
-
Error while installing Oracle 10G Grid control in RHEL
I was installing Oracle 10G Grid control in RHEL. Got the following error. Any idea what this means and what is the remedy? ======================================= Output generated from configuration assistant "Oracle Net Configuration Assistant": /h
-
Flex 4.1 SDK compilation error=3
I just downloaded SDK 4.1 and tried to compile my application but I'm getting the following error: C:\projects\MyProject\build.xml:119:Execute failed: java.io.IOException:CreateProcess: "C:\Program Files\Adobe\Adobe Flash Builder Plug-in Beta 2\sdks\
-
Using Discoverer with Oracle Portal - URGENT!!!
I need to setup Oracle Portal 3.0 with Discoverer 3i for a demonstration tomorrow due to a "this just came in!" from the management! ;) What I would like to do it to display some sort of Discoverer portlet so anyone with a browser can access and view