Feature #17498
closedPrevious/Next Buttons on Form to change records
0%
Description
To quickly change between records without closing and reopening the form, buttons with a link to the previous/next record will be included in the form title. To achieve this functionality three new Form.parameter are introduced:
Name | Type | Note |
btnPreviousNextSql | string | Query that selects all the records that should be accessible by the previous/next buttons. The query uses four different keywords (id, [ btnPrevious ], [ btnNext ], [ btnCurrent ]. More details below. |
btnPreviousNextLoop | digit | 0:off (default), 1 If enabled and the first/last record is reached, the previous/next button points to the last/first record. |
btnPreviousNextWrap | string | HTML to wrap the buttons. Default: <span class="pull-right"><div class="btn-group" role="group"> |
Name | Requirement | Note |
id | required | {{! SELECT ... AS id ... }} Primary key from the table that will be used to generate the links |
btnPrevious | optional | {{! SELECT ... AS btnPrevious ... }} Implements AS _link notations and allows for a custom previous-button. Default: button with glyphicon-arrow-left |
btnNext | optional | {{! SELECT ... AS btnNext ... }} Implements AS _link notations and allows for a custom next-button. Default: button with glyphicon-arrow-right |
btnCurrent | optional | {{! SELECT ... AS btnCurrent ... }} Implements AS _link notations and allows for a custom current-button. Will be placed between previous- and next-button. Default: nothing |
Example for the simplest use case:
btnPreviousNextSql={{! SELECT id AS id FROM ... WHERE ... ORDER BY ... }}
Example for a more complex use case:
btnPreviousNextSql={{! SELECT id AS id, 'p:{{pageSlug:T}}...' AS btnPrevious, 'p:{{pageSlug:T}}...' AS btnNext, 'p:{{pageSlug:T}}...' AS btnCurrent FROM ... WHERE ... ORDER BY ... }}
It has been decided that the previous- and next-button link to another record. The possibility to perform a "form update" using the API to load the values of another record into the form without leaving the page was eliminated. Cause was the URL and SIP which would stay unchanged.
Files