This gave me clue on what happened. I was trying to test out if the
getWindow() work on initialize method of the included component



public class ProductIntroUI extends BoxPane implements Bindable {

    @BXML
    PushButton apply;
 @Override
    public void initialize(Map<String, Object> map, URL url, Resources
rsrcs) {

        System.out.println("Check my window is "+getWindow().toString());

        this.apply.getButtonPressListeners().add(new ButtonPressListener() {

            @Override
            public void buttonPressed(Button arg0) {
                Window w = getWindow();
                ......
               do something with the window here.
               .....
            }
        });
    }
}


The first call to show what is the window wasn't working. I guess because at
that time the UI is not fully loaded so it is not working yet. After
actually put the getWindow() in the listener, the window did get found. I
think the code was in the run place since the listener will be called after
the whole UI was loaded the window was assigned at the moment the listener
got called--
View this message in context: 
http://apache-pivot-users.399431.n3.nabble.com/Dynamically-adding-components-to-a-boxpane-and-ID-already-used-error-tp2885412p2886147.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Reply via email to