views:

209

answers:

1

I am using MasterDetailsBlock on my FormPage. I would like to adjust the screen width for the master and details part of the form. I had been searching around and haven't found a way to do it. The documentation seems to suggest it is doable through the SashForm, but I do not see how.

It will be great if I can use percentage ratio, like the FormAttachment style, but if that is not possible..I'm ok to fix the master and details to specific pixel also.

A: 

Just use SashForm.setWeights(int[]) to modify the weights of the master and the detail in the MasterDetailsBlock.

The weights describe the size ratio of the SashForm's parts. {1, 2} for examble would make the detail twice as wide as the master.

ftl
Add what point should I call it? I tried it before and got some error, I forgot which one; either IndexOutOfBound or IllegalArgument because the size of array did not match with number of children.
DJ
I got it working, I have to call the sashForm.setWeight() inside MasterDetailsBlock.createContent() after calling super.createContent() to make sure all master and details parts are already created so I have matching number of children in sashForm.
DJ