Hi,
I got a box pane originally looked like this
....
......
The two included Bxmls are the same thing but having differences on the
text, labels, icons. When the program runs and this include work perfectly.
When I tried to make the adding of the included bxmls in a dynamic fashion
within the initialize method of the MyWindow java code like the following
@Override
public void initialize(Map<String, Object> map, URL url, Resources
rsrcs) {
..........
some how figure out the URL of the bxml urls for prod1.bxml and prod2.bxml
as prod1BxmlURL and prod2BxmlURL here
...........
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
Object o = bxmlSerializer.readObject(prod1BxmlURL);
this.prodListing.add((Component) o);
o = bxmlSerializer.readObject(new URL(prod2BxmlURL);
this.prodListing.add((Component) o);
} catch (IOException ex) {
Logger.getLogger(EappPlatformUI.class.getName()).log(Level.SEVERE, null,
ex);
} catch (SerializationException ex) {
Logger.getLogger(EappPlatformUI.class.getName()).log(Level.SEVERE, null,
ex);
}
}
The second one got added got me a SerializationException stating the bxml id
apply used within the prod2.bxml is already in use. Since they are identical
in structure, the is the same. The identical part is a bind component
defined in java code. like this
public class ProducUI extends BoxPane implements Bindable {
@BXML
PushButton apply;
.....
....
Is this kind of dynamic adding components allowed? Why are they working just
fine when I use the include tag but having issues when adding them through
the java code?
Sam
--
View this message in context:
http://apache-pivot-users.399431.n3.nabble.com/Dynamically-adding-components-to-a-boxpane-and-ID-already-used-error-tp2885412p2885412.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.