In your current approach, the retrieval logic is bound to two separate, independent UI controls that "don't work together", and a change in either will fire the RPC call, regardless whether that change is user-initiated (selecting a dropdown) or calculated (programmatically).

Since an invalid state can only be reached when perPage is set, you could introduce an intermediate step: bind the dropdown's value to a different Var, perform the constrain logic in the control's change event as you are doing now to compute a potentially different current page number, and set that to currentPage in your model. This way, you "surround" your UI control with the extra check, instead of letting it trigger an unnecessary state change.

By on 11/16/2021 5:05 AM ()

This works perfectly and is a simple solution, thanks!

By on 11/17/2021 2:49 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper