mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Using a condition based on another field for a default value in a boolean or checkbox widget does not work

Open raherin opened this issue 1 year ago • 1 comments

If you have several checkbox widgets and have a 'select all' type widget for one of the fields and set consecutive fields to default as 'true' if the first field is ticked does not behave in the app the same way it does in QGIS.

To reproduce:

Using an expression like CASE WHEN "tick_all" IS TRUE THEN TRUE END or if("tick_all" = true, true, column) as the default value in a boolean field so that the value is set to 'true' if the "tick_all" field is 'true' otherwise the field can be ticked or left un-ticked by the user.

image

This behaves as expected in QGIS. However, in the app, the consecutive fields are greyed out and cannot be set to true if the 'tick_all' field is set to 'false' (see video attachment)

https://github.com/MerginMaps/mobile/assets/26321345/5995cc77-ab98-41cf-a619-3ae4f12b277d

I've created a public example project here: https://app.merginmaps.com/projects/support/test-bool_auto_select/

raherin avatar Feb 09 '24 14:02 raherin

Not sure if this is really a bug. We intentionally make "apply default value on update" fields read-only as it does not make much sense to let them be editable. The thing is any change in any field would override your entered value in such fields.

tomasMizera avatar May 03 '24 07:05 tomasMizera

Fields marked as "apply default value on update" are intentionally greyed out for now in the app.

tomasMizera avatar Jul 11 '24 13:07 tomasMizera