pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ninjathehunter <kzhang...@gmail.com>
Subject Re: Cannot config a button press listener outside the initialize method of Bindable
Date Sat, 02 Aug 2014 21:50:03 GMT
Hi Roger

Many thanks for your reply.

I have just found the cause of this. Basically, I called the readObject
twice, one on the frame that contains MyPanel, and one on the MyPanel
itself. This created two instances of MyPanel unfortunately. The listener I
added is added to the second instance, which is a standalone instance, not
attached to the main frame.

(MainFrame) bxmlSerializer.readObject(MainFrame.class,
"/gui/MainFrame.bxml"));
(MyPanel) bxmlSerializer.readObject(MyPanel.class, "/gui/MyPanel.bxml"));

I would also like to ask it is possible to get grand-child component of a
component (a component that is not a direct child of a component).

For example, in the above example: MainFrame contains MyPanel, MyPanel
contains MyButton.

Is it possible to get MyButton directly from the instance of MainFrame?

I tried myFrame.getNamedComponent() method. But it looks like it can only be
used to get direct child of a component.

Thank you very much.




--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Cannot-config-a-button-press-listener-outside-the-initialize-method-of-Bindable-tp4022979p4022981.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Mime
View raw message