g3w-suite / g3w-client

Map viewer addon for G3W-SUITE
https://g3w-suite.readthedocs.io/en/latest/g3wsuite_client.html
Mozilla Public License 2.0
21 stars 17 forks source link

Handle selection of multi values on input widget value relation #673

Closed volterra79 closed 1 month ago

volterra79 commented 1 month ago

Closes: #672 Related to https://github.com/g3w-suite/g3w-client-plugin-editing/pull/132 in case of filter_expression

Screenshot from 2024-10-07 17-50-36

Raruto commented 1 month ago

@volterra79 I get this warning when I open the form:

image

volterra79 commented 1 month ago

@Raruto i'll check. Thanks

volterra79 commented 1 month ago

@wlorenzetti it seems that editing fields configuration about widget relation, key, value are inverted:

QGIS setting input sybtype wiget :

Screenshot from 2024-10-10 11-07-35

G3W-SUITE server configuration from api:

{
    "name": "subtype",
    "type": "varchar",
    "label": "Subtype - Dependent on the value of Type",
    "editable": true,
    "validate": {},
    "pk": false,
    "default": "",
    "input": {
        "type": "select_autocomplete",
        "options": {
            "values": [],
            "default": null,
            "key": "subtype",
            "value": "pkuid",
            "usecompleter": false,
            "orderbyvalue": true,
            "allowmulti": true,
            "layer_id": "type_subtype_caec4a0b_e7c4_4542_b59c_769f2033d6b1",
            "loading": {
                "state": null
            },
            "filter_expression": {
                "expression": "\"type\" = current_value('type')",
                "referenced_columns": [
                    "type"
                ],
                "referenced_functions": [
                    "current_value"
                ],
                "referencing_fields": [
                    "type"
                ]
            }
        }
    }
}