Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Expressions for default values #3833

Closed
1 task done
gioman opened this issue Aug 8, 2023 · 3 comments
Closed
1 task done

[Question]: Expressions for default values #3833

gioman opened this issue Aug 8, 2023 · 3 comments
Labels

Comments

@gioman
Copy link
Contributor

gioman commented Aug 8, 2023

What is the question?

In this doc page:

https://docs.lizmap.com/current/en/publish/configuration/expression.html

there is a hint at the support of expressions for Default values in forms:
"For editing, it’s possible to use expressions for constraints, default value, group visibility".

but in the advanced forms documentation there are no examples for default values

https://docs.lizmap.com/current/en/publish/configuration/layer.html#advanced-form

just visibility by expression, constraints and filters for value relations, that as a fact all seems to work, but defaults does not.

So I'm left guessing if expressions for defaults are really supported or not.

Versions

QGIS Server and Desktop 3.28, LMWC latest 3.6

Check Lizmap plugin

  • I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.

QGIS server version, only if the section above doesn't mention the QGIS Server version

3.28

Operating system

Ubuntu 22.04, desktop and server

Browsers

Firefox, Chrome

Browsers version

Latest

Relevant log output

No response

@gioman gioman added the question label Aug 8, 2023
@Gustry
Copy link
Member

Gustry commented Aug 8, 2023

Duplicate of #3226

Also asked on the mailing list : https://lists.osgeo.org/pipermail/lizmap/2023-August/000669.html
Please answer as well what was your context (new feature or existing feature), your expression, geometry needed etc.

@Gustry Gustry closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
@gioman
Copy link
Contributor Author

gioman commented Aug 8, 2023

Also asked on the mailing list : https://lists.osgeo.org/pipermail/lizmap/2023-August/000669.html

@Gustry yes sorry for that, but many questions on the list go unanswered (see my previous one about how to extend ckeditor in the landing page) that one person can get frustrated and tries to use as many channels possible to try get feedback.

Please answer as well what was your context (new feature or existing feature), your expression, geometry needed etc.

My use case, the one that triggered the question is:

draw a point > fill the table with X and Y values

fill a field with a numeric values and have another field be automatically filled with a (text) class that depends on that number.

As asked in the list I would like to understand if achieving full support for defaults based on expression is "just" hard to implement or impossible for some reason. Thanks!

@Gustry
Copy link
Member

Gustry commented Aug 9, 2023

I mainly put the link to the mailing list for users finding this ticket to have more info (or search engines).
It was less than 24 hours on the ML ;-)

draw a point > fill the table with X and Y values

For some use cases, such as this one, it's possible to use use PG triggers (yes it's more complicated to set up, but it's a workaround which is working very well)

Let's continue the discussion on a single ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants