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

Change bottonInset on a subform

Avatar

Avatar
Validate 1
Level 2
marcink-lwR9iu
Level 2

Likes

2 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
marcink-lwR9iu
Level 2

Likes

2 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
marcink-lwR9iu
Level 2

12-09-2018

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

12-09-2018

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?

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

15-09-2018

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";