Including parameters with gsftSubmit?

Stephen W_
Giga Guru

When running UI Actions, gsftSubmit can be used to execute the serverside section of your script after the client-side portion has been run.

However, there seems to be a glarin omission from the documentation.     gsftSubmit.

It's used on many OOB ui actions, but no documentation in the wiki.

Example:
I want to collect a value from the user with a client action and use it along with current.somevalue.

If I am able to include a parameter in that gsftSubmit, (and consume it in the ui action) it makes this very clean.  

Otherwise, I'm thinking I can use g_scratchpad..

On a related note, I also see in the library: gsftPrompt, gsftConfirm, and gsftListSubmit.

Has anyone used these or know where I can find documentation/examples?

Thanks,

-Stephen

9 REPLIES 9

Finally, I found my way around the limitation by saving parameters to a user preference and then retrieving the value of that preference on the server side.


Slava, can you show an example ui action where you do this?


The more usual way would be to add a field to your form (you could hide it if you want), and save the value you get from the user in that field before you perform the submit.


vincentb
Tera Contributor

Hi Stephen, I haven't found a way to use parameter.



But as a workaround you can create another inactive UI Action with a different "Action name".


Then you call one or the other in your main UI Action.


Example below:



function create_prob_call(){


  if(confirm("Do you want to add the incident affected CIs in the problem?")){


  return gsftSubmit(null, g_form.getFormElement(), 'create_prob_from_inc');


  }


  else{


  //We call the inactive UI Action with this name. This is a workaround because we can't push a parameter


  return gsftSubmit(null, g_form.getFormElement(), 'create_prob_from_inc_no_ci');


  }


}


Sandy48
Kilo Contributor

hi @steve4king,

Have you found any document for gsftPrompt, gsftConfirm, and gsftListSubmit.

Please can you share the document if you have found any.