Book a Demo

Author Topic: Scripting does not show Input  (Read 4115 times)

chimp-pl

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Scripting does not show Input
« on: March 05, 2019, 07:25:34 pm »
Hi All,

I am getting mad with this issue. Trying to prompt for the Input from user but Input does not show up.
I used JavaScript and VBA following lines:

JS: Session.Input("Provide name of the document");
VBA: Session.Input "Provide name of the document"

Appreciate any help and suggestion how to solve it!

Thanks,
Szymon

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Scripting does not show Input
« Reply #1 on: March 05, 2019, 08:03:14 pm »
There was a bug related to Session.Input; doesn't work.

As an alternative you can use InputBox in VBScript
Example:

Code: [Select]
dim modelName
modelName = InputBox( "Please enter new name for the data model", "Data Model Name" )

Geert

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Scripting does not show Input
« Reply #2 on: March 05, 2019, 09:44:27 pm »
Yes Geert is correct there was a bug in Session.Input

His alternative method if input is great and one I have used myself.

I believe the bug has been fixed in the latest release of EA 14.1 Feb 6th 2019

Phil
Models are great!
Correct models are even greater!

chimp-pl

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Scripting does not show Input
« Reply #3 on: March 06, 2019, 02:14:52 am »
Thank you for prompt response.

What would be the equivalent for JavaScript?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Scripting does not show Input
« Reply #4 on: March 06, 2019, 03:04:03 am »
I don't think there is one, but you can circumvent that
If you have enabled the EA Scripting MDG you'll find this in the script Jscript-Dialog:

Code: [Select]
function DLGInputBox( promptText /* : String */, title /* : String */, defaultText /* : String */ ) /* : String */
{
// JScript has no intrinsic InputBox method, therefore we have to steal VBs
var vbe = new ActiveXObject("ScriptControl");
vbe.Language = "VBScript";

return vbe.eval( "InputBox(\"" + promptText + "\",\"" + title + "\",\"" + defaultText + "\")");
}
There is a slight difference between VBScript and Javascript in how to create the Scriptcontrol (I don't remember the details), but other then that it should be pretty much the same

Geert