I have added the new for each instance. I do not understand why I can not add a composite multiple times. Does anyone know of a way to mimic this behavior if this is not directly possible. If I need to have 50 identical things on the page, having to create 50 manually is ridiculous, I should be able to create one that I can use multiple times.
On Nov 23, 10:43 am, ep <[email protected]> wrote: > what jhulford meant is that you really have to make a "new" on every > widget class you add to any place. > > On 22 Nov., 06:00, Paul <[email protected]> wrote: > > > > > > > > > Sorry if this is somewhere else and I missed it, but I have aCustom > > Widget that I need to be able to addmultipletimesto anothercustom > > widget I am creating. I do not seem to understand something about this > > process and so I get the following errors: > > > "Different parents for double associations" > > "The other component is added to a parent component more than once." > > > So basically, the first one gets nuked and only the second one shows > > up. What am I missing? Can someone please assist me in understanding > > what is wrong. Thank you so much in advance. Below is the code: > > > public class FirstClass extends Composite > > { > > public FirstClass() > > { > > Image image = new Image("img/picture.png"); > > AbsolutePanel element = new AbsolutePanel(); > > > element.add(image, 0, 0); > > > initWidget(element); > > } > > > } > > > public class SecondClass extends Composite > > { > > public SecondClass() > > { > > HorizontalPanel element = new HorizontalPanel(); > > > VerticalPanel elementA = new VerticalPanel(); > > element.add(elementA); > > > VerticalPanel elementB = new VerticalPanel(); > > element.add(elementB); > > > elementA.add(new FirstClass()); > > elementB.add(new FirstClass()); > > > initWidget(element); > > } > > > } -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
