Database paging in DSP component and in Form component
| Author | PBeugel |
|---|---|
| Date submitted |
|
| Category | Uniface Coding |
| Sample file |
|
Description
This sample demonstrated contains examples how database paging can be used in Uniface forms and DSP components. With the modeled entity PAGING in model CONTROL it's easy to implement database paging on an Uniface component. To use paging in the components these 4 steps will make the paging work: 1) Paint entity PAGING from model CONTROL and all its fields. In the <LPM> are all the entries needed defined: initbuttons , startpage , getpage , storepage , cleartheent 2) The read trigger of the involved entity must be changed to variables numeric vOffset endvariables vOffset = (PageNum.<thecontrol> - 1) * PAGESIZE.<thecontrol> read options "maxhits=%%PAGESIZE.<thecontrol>%%%·;offset=%%vOffset%%%" order by "<anfield>" if ($status=0) rnum.<theent>=vOffset+$curocc endif 3) Add Field RNUM as non-database numeric field to display rownumber for an occurrence. 4) In defines of the component define the involved entity , entity used for control , field used for sorting , and the pagesize must be defined.
