Project

General

Profile

Actions

Feature #17498

closed

Previous/Next Buttons on Form to change records

Added by Jan Haller 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Jan Haller
Target version:
Start date:
20.12.2023
Due date:
% Done:

0%

Estimated time:
Discuss:
Prio Planung:
No
Vote:

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">
The keywords in btnPreviousNextSql allow the developer to customize the buttons.
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

Actions

Also available in: Atom PDF