Populating form via URL
fr0mtheinternet opened this issue · 7 comments
How realistic a proposition would it be to allow for the population of form fields via URL, in the same format as a GET request?
For instance, the standard format is:
https://hostname/jea/?cmdid=somecommand
What I propose is:
https://hostname/jea/?cmdid=somecommand&psparam_parameter1=first&psparam_parameter2=last
Maybe even a submit action as well?
That way, you could format the results of one command into links that perform the requested action in another. Obviously you'd have to make sure the user has appropriate access but that's part of the process anyway.
For example, you may have an AD user search. And then if you want to modify one of the attributes you could click the link within the output which then directs you to the command for modifying user attributes, but with the identity (amongst other things) already completed.
It could also potentially be a workaround for dynamic parameters.
This is already supported.
The auto-submit action could be implemented using the onload command. The implementation was a contribution has requires the onload script to have the same parameters as the regular script.
Ah, that's working brilliantly, thank you!
I'm not sure I understand your meaning for the onload solution. Is there a solution already available, or do you mean it should be possible with some development time?
Words are hard. If your "onloadscript" and "script" PowerShell scripts have the same parameters, then you should be able to pass querystring or form variables for a script to run automatically.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@markdomansky
Do you have any demo or documentation on this functionality?
I do not understand exactly how to implement 'auto-submitting', but maybe I am thinking about this the difficult way...
It is not documented (well? at all?). the onloadscript processes parameters as long as those parameters are also defined in the script. This is how the user-submitted code handles it. I'm handling it differently in the next version.
Once the onloadscript and script have the same parameters, you should be able to pass parameters in the query string or the post data and the onloadscript will use them.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.