Skip to content

Render QGIS CheckBox-widget fields as real checkboxes in popups#6750

Open
meyerlor wants to merge 1 commit into3liz:masterfrom
meyerlor:feat/popup-checkbox-widget
Open

Render QGIS CheckBox-widget fields as real checkboxes in popups#6750
meyerlor wants to merge 1 commit into3liz:masterfrom
meyerlor:feat/popup-checkbox-widget

Conversation

@meyerlor
Copy link
Copy Markdown
Collaborator

Fields configured with a CheckBox edit widget in QGIS previously displayed their raw value ("Ja", "Nein", "true", "false", etc.) in the feature popup, instead of mirroring the editing form's native checkbox.

This change covers two popup render paths:

  • Auto popup (popupDefaultContent, popup_all_features_table): new jTpl modifier popupcheckbox is used in place of featurepopup; receives a per-layer map of CheckBox fields resolved from the QGIS project XML by WMSRequest::getCheckBoxFieldsForLayer.

  • QGIS/form popup (popupSource=form|qgis): WMSRequest::applyCheckBoxesToFormPopup post-processes the form HTML returned by QGIS Server, replacing the text inside each with a disabled when the field is a CheckBox widget.

Matching is lenient so the common real-world variants all render as checkboxes: the configured CheckedState/UncheckedState, common boolean representations (true/t/1/yes/on and false/f/0/no/off) for fields stored as boolean, and null-like values ('', NULL, QGIS's '()') which render as unchecked.

Fixes #6748

For Auto-Popups:
grafik

For Drag n Drop Forms:
grafik

Fields configured with a CheckBox edit widget in QGIS previously
displayed their raw value ("Ja", "Nein", "true", "false", etc.) in the
feature popup, instead of mirroring the editing form's native checkbox.

This change covers two popup render paths:

* Auto popup (popupDefaultContent, popup_all_features_table):
  new jTpl modifier popupcheckbox is used in place of featurepopup;
  receives a per-layer map of CheckBox fields resolved from the QGIS
  project XML by WMSRequest::getCheckBoxFieldsForLayer.

* QGIS/form popup (popupSource=form|qgis):
  WMSRequest::applyCheckBoxesToFormPopup post-processes the form HTML
  returned by QGIS Server, replacing the text inside each
  <span id="dd_jforms_view_edition_FIELD" class="jforms-control-input">
  with a disabled <input type="checkbox"> when the field is a
  CheckBox widget.

Matching is lenient so the common real-world variants all render as
checkboxes: the configured CheckedState/UncheckedState, common boolean
representations (true/t/1/yes/on and false/f/0/no/off) for fields
stored as boolean, and null-like values ('', NULL, QGIS's '()') which
render as unchecked.

Fixes 3liz#6748
@meyerlor meyerlor force-pushed the feat/popup-checkbox-widget branch from 2479b75 to ce55b9f Compare April 17, 2026 07:40
@mdouchin mdouchin requested a review from rldhont April 17, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attribute View in view / non-edit mode improvement

1 participant