g1_
13 Oct 2009, 3:09 AM
I'm a little confused about this one and am not able to find a solution.
I've got a ContentPanel (parent) that contains another ContentPanel (idlePanel). When an event occurs triggered by and drag and drop I remove idlePanel from parent and add activePanel. Something like this:
DropTarget target = new DropTarget(xxx) {
@Override
protected void onDragDrop(DNDEvent event) {
Info.display("MessageBox", "Event occured");
parent.remove(idlePanel) ;
parent.add(activePanel) ;
render(parent.getElement()) ;
}
};
The problem I'm getting is that the first time the event occurs the activePanel doesn't display. It displays the header of activePanel but not it's contents.
This parent panel sits in a TabPanel. If you get to this state where activePanel's content is not displayed and then change to another tab and back again then activePanel's content is now displayed correctly.
I'm guessing this is because I need to prerender activePanel?
If the event happens a second time it displays activePanel correctly however none of the buttons in that panel work. Again by changing to another tab and back again these buttons start working again.
I'm guessing that after removing idlePanel from parent and adding activePanel I need to wake it up in some way and get it to render and function properly but I'm not sure how to do this.
Anyone got any tips on the correct way to do this?
Thanks,
g1_
I've got a ContentPanel (parent) that contains another ContentPanel (idlePanel). When an event occurs triggered by and drag and drop I remove idlePanel from parent and add activePanel. Something like this:
DropTarget target = new DropTarget(xxx) {
@Override
protected void onDragDrop(DNDEvent event) {
Info.display("MessageBox", "Event occured");
parent.remove(idlePanel) ;
parent.add(activePanel) ;
render(parent.getElement()) ;
}
};
The problem I'm getting is that the first time the event occurs the activePanel doesn't display. It displays the header of activePanel but not it's contents.
This parent panel sits in a TabPanel. If you get to this state where activePanel's content is not displayed and then change to another tab and back again then activePanel's content is now displayed correctly.
I'm guessing this is because I need to prerender activePanel?
If the event happens a second time it displays activePanel correctly however none of the buttons in that panel work. Again by changing to another tab and back again these buttons start working again.
I'm guessing that after removing idlePanel from parent and adding activePanel I need to wake it up in some way and get it to render and function properly but I'm not sure how to do this.
Anyone got any tips on the correct way to do this?
Thanks,
g1_