Screen parameter-map optimization suggestion

ie

<link url="downloadContent" text="Download" parameter-map="[exampleId:exampleId, contentLocation:contentLocation]"/>

if the map’s key-value is the same field,I recommend omitting the latter field:

<link url="downloadContent" text="Download" parameter-map="[exampleId:, contentLocation:]"/>

or

<link url="downloadContent" text="Download" parameter-map="[exampleId, contentLocation]"/>

1 Like

Thanks for coming on to the forum!

How the parameter-map actually works is it’s a groovy expression see: https://www.baeldung.com/groovy-maps#creatingMaps. So what you suggest would save some time writing the same thing twice, but we don’t really have control over the syntax used there unless we write our whole own programming language.

If you’re interesting in something like that let me know, but it’d take a lot of work and better be very worth it. I wrote a bit about that here: Domain Specific Languages.

First of all, thank you for your reply.

As a tool of formal logic, language has a natural binding and adaptation relationship with usage scenarios. I am also very interested in this.

At present, I am still trying to complete the first project using moqui practice , I hope that after practicing one or two projects, I will have a more thorough understanding of moqui.

At that time, feedback the experience and insights to the forum.