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

How to create a drill down form with Lizmap #4898

Closed
1 task done
arno974 opened this issue Oct 22, 2024 · 5 comments
Closed
1 task done

How to create a drill down form with Lizmap #4898

arno974 opened this issue Oct 22, 2024 · 5 comments

Comments

@arno974
Copy link

arno974 commented Oct 22, 2024

What is the question? (in English)

Hello,

For a lizmap project I need to report damages made to bus stop furniture (example : the bin has been destroyed). To create a new damage report, users have to click on a bus station and then select one of the furniture linked to this bus station.

To only link the furniture related to this bus station, I must create a linked drop-down lists.

So I've three tables :

  • bus_station : geolocalized postgis table point
  • furniture : PostgreSQL type with an FK link to bus_station
  • damages : PostgreSQL type with an FK link to furniture and bus_station (a damage is linked to a a furniture and to a bus station).

I've configured the relationships in QGIS and set up the QGIS form id_arrets_bus and id_mobiliers fields.

QGIS form id_arrets_bus id_mobiliers parameter
image

QGIS form id_mobiliers field parameter
image

In QGIS, the furniture is correctly filtered according to the selected stop.
image

But in Lizmap, the drop down list remains empty
image

I have read that Lizmap is able to use QGIS Expression and filters but it doesn't seems to work in my case.

Have you ever had to create nested drop-down lists? If so, could you please explain me how to do it ?

Thanks,

Arnaud

Versions, safeguards, check summary etc

Versions :

  • Lizmap Web Client : 3.7.11
  • Lizmap plugin : 4.4.2
  • QGIS Desktop : 3.34.4
  • Lizmap.com : Yes
  • QGIS Server : 3.34.11
  • Py-QGIS-Server : 1.9.1
  • QGIS Server plugin DataPlotly : Not installed
  • QGIS Server plugin atlasprint : 3.4.1
  • QGIS Server plugin cadastre : 1.20.0
  • QGIS Server plugin lizmap_server : 2.11.2
  • QGIS Server plugin wfsOutputExtension : 1.8.2
List of Lizmap Web Client modules :
* Version Lizmap Web Client 3.8 needed
List of safeguards :
* Mode : normal * Allow parent folder : no * Prevent other drive : yes * Prevent PG service : yes * Prevent PG Auth DB : yes * Force PG user&pass : yes * Prevent ECW : yes

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.

Operating system

Ubuntu 24.04

Browsers

Firefox

Browsers version

Firefox 131

Relevant log output

No response

@Gustry
Copy link
Member

Gustry commented Nov 6, 2024

I think this question might be linked to discussion on the pinned ticket about expressions : #3226, especially the comment #3226 (comment)

It would be nice if you can provide a PR on the repository, with the existing test data to have use case.

BTW, it seems the screenshot is wrong, for the second one.

@arno974
Copy link
Author

arno974 commented Nov 7, 2024

Hi Gustry,

I'm not quite sure that this is the same use case, as in my case I've no geometry. The two tables are only attributes table.

I don't think there is an error with the second screenshot. What makes you think that?

I can't make a public PR with the project as it is a customer project, but I will send you the project.

Thanks

@Gustry
Copy link
Member

Gustry commented Nov 7, 2024

I'm not quite sure that this is the same use case, as in my case I've no geometry. The two tables are only attributes table.

Yes, I was referring to my comment, there are quite a few context about evaluating expressions. See the comment #3226 (comment)

It's this use case :

One or many fields lost the focus (according to what the expression needs)

I don't think there is an error with the second screenshot. What makes you think that?

Look at the screenshot about Lizmap, it's exactly the same screenshot as the one above in QGIS...

But in Lizmap, the drop down list remains empty

And about

I can't make a public PR with the project as it is a customer project, but I will send you the project.

Sorry, I don't mean with your data. I was talking about a PR with the test data already in the repository, or creating a simple PG table in the SQL file. https://github.com/3liz/lizmap-web-client/blob/master/tests/README.md

@Gustry
Copy link
Member

Gustry commented Nov 7, 2024

Just checking quickly, this should work already :

https://sandbox.lizmap.com/lizmap_3_8/index.php/view/map?repository=tests&project=form_advanced

If you :

  • select form_advanced_point
  • Draw a point
  • The quartier is already filled (neighborhood)
  • The sousquartier is pre-populated according to the previous neighborhood value (sub-neighborhood)

So the issue is somewhere. Anylogs about when expressions are evaluated ? Is the HTTP requests sent when you change the value in the dropdown menu ?

@Gustry
Copy link
Member

Gustry commented Nov 15, 2024

This GitHub repository accept only "bug reports". Questions must go to another channel such as Discourse for instance.

if you think it's a proper bug, please open a new detailed bug report, with the latest version of Lizmap available.

@Gustry Gustry closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants