0

Borderlayout initially has no height

asked 2021-01-21 18:39:18 +0800

assonaZkDev004 gravatar image assonaZkDev004
101 2

Hello :-)

I'm getting crazy with this effect:

I create a popup window with an inlying borderlayout in the doAfterCompose. There ist no ZUL-file, just the Composer to create the components. Problem: All components are created correctly, but initially the borderlayout has no height, the window opens apparently empty. If you resize the window (just pull a little bit by the frame), the content appeares. Why does this happen?

Here ist the code (without the data filling parts):

@Override
public void doAfterCompose(final Window win) throws Exception {
    super.doAfterCompose(win);
    win.setHeight("600px");
    win.setWidth("800px");
    ...

    final Borderlayout bl = new Borderlayout();
    bl.setHflex("1");
    bl.setVflex("max");
    bl.setParent(win);

    final North north = new North();
    north.setParent(bl);
    north.setHflex("1");
    north.setVflex("min");
    final Component toolbar = createToolbar();
    toolbar.setParent(north);

    final Center center = new Center();
    center.setParent(bl);
    center.setHflex("1");
    center.setVflex("1");
    center.setAutoscroll(true);

    (here comes content for center...)

    final South south = new South();
    south.setParent(bl);
    south.setHflex("1");
    south.setVflex("min");

    final Div btnDiv = new Div();

    btnDiv.setParent(south);
    (here come some buttons...)
    btnEsc.setParent(btnDiv);
    btnSave.setParent(btnDiv);
}
delete flag offensive retag edit

Comments

which version are you using? for faster verification you can provide a runnable example on https://zkfiddle.org

cor3000 ( 2021-01-22 10:49:10 +0800 )edit

I created a runnable version here: https://zkfiddle.org/sample/19gv39v/1-Borderlayout-initially-has-no-height

to me it works with 9.5.0.2/8.6.4.1 didn't try any older versions, maybe you can provide the missing information to reproduce this

cor3000 ( 2021-01-22 15:07:04 +0800 )edit

Hello #cor3000,

thank you very much for your fast response and your example (we also use ZK 9.5.0.2).

We finally solved it by giving the center area an additional Vlayout and triggering the Borderlayout content event-based. Now it works :-)

assonaZkDev004 ( 2021-01-25 15:52:49 +0800 )edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2021-01-21 18:39:18 +0800

Seen: 2 times

Last updated: Jan 21

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More