Is it possible to reference another controls property either in the UI XML or in code?
For example, let's say I have a MainFrame with a borderlayout and docked to the north panel I want to include PanelX, how can I set the Height property of the North region to be the height of PanelX?
i.e. I would like to be able to do this sort of thing...
or something similar.
This question is marked "community wiki".
asked 27 Apr '13, 21:59
A use case would be the example in my question above, i.e. you have a border layout and in one of the regions you want to set the size of a given region to the size of something else.
I built a small application using border layout, I had a grid in the north region, a grid in the center, a gauge in the east and west; when the application opened the north region was so small that it only displayed the header of the grid so I set the height of the north region and this worked but I could not get the height region set correctly easily to match the grid height in the way I wanted.
What I wanted to be able to do always ensure that the north grid only displayed 3 rows at a time and then tell the borderlayout that the north region was the same size as the 3 row grid.
answered 28 Apr '13, 05:52
In order to ensure that the grid displays 3 rows at a time, you have to calculate and set the height of the cell containing the grid manually.
Then, you can simulate the need of referencing grid panel's width using tableLayout and the
In your case, you can implement a wrapper panel simulating a borderLayout as follows:
Then you can use this wrapper panel in your mainFrame:
But please note that since the Dynamic heightPolicy requires some calculations at the client(JS) part, it's usage should be limited as much as possible since the excess usage of this feature may slow down the application performance.
Hope this helps,
answered 29 Apr '13, 03:38
Ibrahim Sand... ♦♦