In javascript I have this variable:
var selectedItemId = null; // the actual value is set from another function
Then I have this function:
function editLink() {
location.href = /*[[@{/supplycontracts/edit/}]]*/'';
}
Now I want to add the variable to the href, so that in the end it looks like this:
http://localhost:8080/myApp/supplycontracts/edit/?contractId=4
The number '4' at the end is the already substituted selectedItemId.
I tried stuff like this:
location.href = /*[[@{/supplycontracts/edit(${selectedItemId})}]]*/'';
But it didnt work.
If I do this:
location.href = /*[[@{/supplycontracts/edit(selectedItemId)}]]*/'';
I only get
http://localhost:8080/supply-app-0.0.1-SNAPSHOT/supplycontracts/edit?selectedItemId
How do I have to pass the selectedItemId to the href so I get the correct link?