Closed MartijnR closed 6 years ago
Is this actually useful enough? Wouldn't it be more useful to redirect upon submission? enketo/enketo-express#476
Especially if the redirect can be dynamic.
To work offline, this would probably require a specially single-submission offline view.
This issue was moved to enketo/enketo#1228
Just putting down some thoughts on this possible future feature:
[link](${calc_href})
When you refer to a ${calc_href} in a label or hint, it gets turned into an XForm
<output>
. In Enketo a markdown[link](href)
gets turned into an<a href="href">link</a>
element when the form is loaded. What we're trying to set dynamically is the href attribute. You'd get something like this syntax in Enketo:<a href="<span class=\"or-output\" data-value=\"/path/to/node\"></span>">link</a>
An attribute cannot be a element, so this approach won't work. It will probably work for the link text but not for the link address itself.
The idea is, however, the way forward to properly enable linking between forms. I think we'd require this:
<output>
element, Enketo would have to process the link differently to make it dynamic, generating something like this:<a href="#" #data-href="/path/to/dynamic/node">link</a>
get-form('widgets')
(This might not be easy - we'd be sending a GET API request without authentication. Moreover, it wouldn't work offline).get-form('widgets', ${a}, ${b}, ${c})
and relying on the same nodeNames to be present in the linked form, or use a map to map values to a different nodename. This may not be feasible for offline-capable forms until we switch from applicationCache to service workers #401, #386.