[Mapbender-users] Mapbender Digitizer - Displaying Non-Editable Information via SQL and Locking Fields on Update

de Lima Guimaraes, Danilo Danilo.deLima at pulheim.de
Tue Apr 9 08:25:11 PDT 2024


Hello Mapbender Community,

I'm configuring a form in Mapbender Digitizer where I need to present additional information in a read-only format. Some fields are numeric IDs from one table that reference labels in another table. The 'type: text' option is not sufficient for these because they lack the descriptive labels necessary for user understanding.

I've used a 'type: select' field with an SQL statement to combine IDs and labels, but I need to ensure that these fields are non-editable. CSS properties (pointer-events: none, opacity: 0.5) were employed to make fields appear disabled, but they can be easily overridden in a browser's developer mode. (Example: https://ibb.co/mG2GdWg - hier I als changed on CSS-Editor for aesthetic reasons: select { appearance: none;   -webkit-appearance: none;  -moz-appearance: none;} )

(A) Is there an option similar to  "mandatory: true" but something like "editable: false" for the types input, date, select, textArea and checkbox?

(B) Is there a way to execute an SQL statement in a 'type: text' field similarly to a 'type: select' field, to present the information securely in a non-editable manner?
Example of current use in a select field:
- type: select
  title: 'ID - Label (Table A) '
  name: tableA_id
  connection: connectionName
  sql: 'SELECT id || '' - '' || label, id AS key from tableA order by id asc;'
  css: { pointer-events: none, opacity: 0.5 }

(C) Additionally, I've considered utilizing the onBeforeUpdate event to lock certain fields from being edited. Is there a way to enforce non-editability for specific fields in the backend upon update, to prevent changes even if the front-end CSS is bypassed?

Any insights or suggestions on how to securely implement this would be greatly appreciated.

Best,
Danilo de Lima

Datenschutzhinweis: Bitte beachten Sie die Information zur Verarbeitung personenbezogener Daten in E-Mail-Eing?ngen der Stadt Pulheim gem?? Art. 13 DS-GVO, abrufbar unter folgendem Link: Datenverarbeitung I E-Mail<https://www.pulheim.de/email-dsgvo>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapbender_users/attachments/20240409/ad9d27aa/attachment.htm>


More information about the Mapbender_users mailing list