This project is read-only.

PagerParameters in a ContentPartDriver

Topics: Writing modules
Jul 19, 2013 at 8:24 PM
Hi All,
I was wondering if there had ever been any update on being able to use PagerParameters directly from a ContentPartDriver, without having to implement a Handler and Controller (Same as what was used in the ContainerPart)?
Just curious..

Jul 22, 2013 at 5:00 PM
Edited Jul 22, 2013 at 5:01 PM
You can currently only use it inside the driver Editor method that handles postback (the one with IUpdateModel parameter) - use updater.TryUpdateModel(...) on the PagerParameters object.

In other methods (eg. Display) it's a bit harder and involves a workaround as you don't have access to controller instance (the IUpdateModel parameter described above) which can handle model binding - take a look at Orchard.Taxonomies.Drivers.TermPartDriver class.

It's already been worked on so in the next release (1.7.1 or 1.7.2) it will be much easier to get current controller instance, thus being able to perform model binding, anywhere.