Project

General

Profile

Feature #17498

Updated by Jan Haller 6 months ago

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 detail 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 <notextile>_link</notextile> notations and allows for a custom _previous_-button. 
 Default: button with glyphicon-arrow-left| 
 |btnNext|optional|{{! SELECT ... AS btnNext ... }} 
 Implements AS <notextile>_link</notextile> notations and allows for a custom _next_-button. 
 Default: button with glyphicon-arrow-right| 
 |btnCurrent|optional|{{! SELECT ... AS btnCurrent ... }} 
 Implements AS <notextile>_link</notextile> 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 ... }} 
 !clipboard-202312221019-p40dm.png! 

 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 ... }} 
 !clipboard-202312221021-obe9z.png! 

 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.

Back