Expand my Community achievements bar.

inject script into a fragment at run time

Avatar

Level 4

Hi,

Consider we have form containing self scripted fragments. Is it possible to change the event scripts of the fragments at run time from the main form?

I tried to use

...event__initialize.script.value = `  `

...execInitialize();

but it did not work.

4 Replies

Avatar

Former Community Member

No you cannot do that ....maybe if you coudl describe why you want to do this we could suggest an alternative.

Paul

Avatar

Level 4

Basically, I have a fragment with radio button exclusion group. And this radio button has a default value (we have 3 values) set by script.

I want to remove default value setting without touching the fragment code from the main form.

Avatar

Level 4

Actually, this was not such a good example for my problem, because I can set it to null in the form:ready event:

this.RadioButtonGroup.Option3.rawValue = null;

In essence, what I need is accessing the event scripts on the objects, subforms.

Avatar

Former Community Member

You woudl have to modfiy the xdp source of the fragment (it is only XML) before the fragmen reference is resolved in your main line form.

Once it is rendered you will not be able to modfiy the script.

Paul