Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Change bottonInset on a subform

marcink-lwR9iu
Level 2
Level 2

Hi

I'm having difficulties on changing SubformB.margin.bottomInset.

On SubformB::calculate I have this script:

if(this.SubformA.instanceManager.count == 1){

  this.margin.bottomInset = "3.2mm";

}

else{

  this.margin.bottomInset = "0mm";

}

console.println("** bottom: " + this.margin.bottomInset);

While I can see the println, with the correct values, the bottom margin doesn't change visually.

Any help on this?

Thanks

1 Accepted Solution
_Bruce_Robertson
Correct answer by
Level 10
Level 10

Should be as simple as that, your form would have to be dynamic and your subform in a flowed container, but I assume it is if you are playing with the instanceManager.

Can you share your form?

View solution in original post

2 Replies
_Bruce_Robertson
Correct answer by
Level 10
Level 10

Should be as simple as that, your form would have to be dynamic and your subform in a flowed container, but I assume it is if you are playing with the instanceManager.

Can you share your form?

View solution in original post

radzmar
Level 10
Level 10

You'll have to force the calculate script to execute to see the desired effect.

Given you have a subform "SF" with a nested subform "SubformA" in it. You'll need two things:

A) A script in the calculate event of "SF"

// Script to set instances of subform "SubformA". Replace with you own script if neccessary!

_SubformA.setInstances(this.rawValue);
// scriot to execute the calculate script of subform "SF"

SF.execCalculate();

B) A script to add/remove instances of SubformA and triggering the calculation script in "SF".

this.margin.bottomInset = this._SubformA.count === 1 ? "3.2mm" : "0mm";