0

Hey all I am trying to run a javascript when the user selects a particular option.

I have created a text file by going to Create -> Technical -> Text File

Once I am there I fill out the needed info:

enter image description here

enter image description here

Then I click on Create And Open: enter image description here

And so I save that and go back to my layout where I am wanting to call it from thedropdown: enter image description here

enter image description here

So as you can see I am doing a Run Script which I call the reqOnOrOff (I also tried just having yo) when the user selects the item called Tunable FFL.

Once that is saved I go view that page in pega itself and open up the console (F12) and refresh the page and then select Tunable FFL from the dropdown and there is no console text saying "hello" as there should be.

enter image description here

enter image description here

The harness:

enter image description here

enter image description here

The overall goal is to be able to dynamically change a textbox required propertieson (it required to fill out) or off (it is not required to fill out).

Anyone that can help me fix this (or tell me what I am doing wrong) would be great!

Thanks

StealthRT
  • 10,108
  • 40
  • 183
  • 342
  • Why is it (java)script? – evolutionxbox Sep 09 '20 at 18:23
  • @evolutionxbox Becasuse when you select a componet (dropdown box) and add the "change" event the event is called "Run Script". This can run many scripts but I am only looking for the Javascript file I created to be accessable after the user changes an item in the dropdown box. – StealthRT Sep 09 '20 at 18:46
  • Did you include that js text file into your harness or application skin rule ? And try just giving the function name in Run Script Action. – AJ. Sep 13 '20 at 15:47

2 Answers2

0

The value in the Action "Run Script" > Function name should be yo, not the name of the text file.

0

To dynamically set if a text input is required, use 'conditional (expression)' or 'conditional (when rules)' option in either App Studio or Dev Studio.

In App Studio authoring, open the field properties. See: https://i.stack.imgur.com/xgLfr.png

In Dev Studio, in your section open the cell properties. See: https://i.stack.imgur.com/r76mm.png

Eric
  • 11
  • 2