Page 1 of 1
My own submit button
Posted: Thu Aug 22, 2019 5:44 pm
by ga6riel
Hello,
I want to hide the variables and the original "Submit" button (in the red retangle below) from the user and use my own variable fields and my own "Submit" button (the blue button with the red arrow).
I had no problem to add, edit and remove variables by code, but I can't simulate the action "Submit" of the original button on my own button...
How can I do that in JavaScript?

Re: My own submit button
Posted: Fri Aug 23, 2019 7:53 am
by Lech Kulikowski
Hello,
The following codes are called when submit is clicked:
Code: Select all
jsStiWebViewer1.reportParams.editableParameters = null;
if (jsStiWebViewer1.reportParams.type == "Report") jsStiWebViewer1.reportParams.pageNumber = 0;
jsStiWebViewer1.postInteraction({ action: "Variables", variables: jsStiWebViewer1.controls.parametersPanel.getParametersValues() });
In that code, you should change getParametersValues with your variables.
Thank you.
Re: My own submit button
Posted: Tue Aug 27, 2019 3:00 pm
by ianwelsh
ga6riel - would you mind sharing your final html + js addition for your custom submit button?
Any thoughts on how you could put your button below the parameters panel and above the report?
Re: My own submit button
Posted: Wed Aug 28, 2019 6:36 pm
by ga6riel
Lech Kulikowski wrote: ↑Fri Aug 23, 2019 7:53 am
Hello,
The following codes are called when submit is clicked:
Code: Select all
jsStiWebViewer1.reportParams.editableParameters = null;
if (jsStiWebViewer1.reportParams.type == "Report") jsStiWebViewer1.reportParams.pageNumber = 0;
jsStiWebViewer1.postInteraction({ action: "Variables", variables: jsStiWebViewer1.controls.parametersPanel.getParametersValues() });
In that code, you should change getParametersValues with your variables.
Thank you.
Hello,
Two questions:
1) What class is instantiated in "jsStiWebViewer1"?
2) I didn't understand how I change getParametersValues with my variables.
For now I have two variables (a String List named "breeds" and a datetime named "collDay").
Can you show me what I need to change in the code above?
Thank you.
Re: My own submit button
Posted: Wed Aug 28, 2019 6:39 pm
by ga6riel
ianwelsh wrote: ↑Tue Aug 27, 2019 3:00 pm
ga6riel - would you mind sharing your final html + js addition for your custom submit button?
Still not working properly for me, sorry.
ianwelsh wrote: ↑Tue Aug 27, 2019 3:00 pm
Any thoughts on how you could put your button below the parameters panel and above the report?
I don't know if it's possible... I'm doing my own parameters panel as well.
Re: My own submit button
Posted: Thu Aug 29, 2019 12:08 pm
by Lech Kulikowski
Hello,
Please check sample in the attachment.
Thank you.