PDA

View Full Version : Adding widget to ContentPanel with Listener



borisperezg
19 Jul 2010, 6:14 AM
Hi people.

I have an AreaChart and I have it an association with a listener:


area2.addChartListener(listener);


Then, the listener implementation is in this way:


private ChartListener listener = new ChartListener() {
public void chartClick(ChartEvent ce) {
if(panelDatos!=null){
Info.display("Chart Clicked", "Panel valido");
panelDatos.addText("Nuevo");
}else
Info.display("Chart Clicked", "Panel es nulo");
}
};


The variable panelDatos is type of ContentPanel and declared as class attribute. When listener is executed Info.display shows "Panel valido" string, so, it doesn't null, but, the text is never shown inside mi ContentPanel.

What do I have to do ? I need to force some refresh or what ?

Thanks people for listening.

oxyrox
19 Jul 2010, 6:43 AM
Yes, you could try to re-layout your contentpanel.

panelDatos.addText("Nuevo");
panelDatos.layout();
If this doesn't help you would have to post a test case implementing EntryPoint showing the problem so we can help.

borisperezg
19 Jul 2010, 8:54 AM
Yes, you could try to re-layout your contentpanel.

panelDatos.addText("Nuevo");
panelDatos.layout();
If this doesn't help you would have to post a test case implementing EntryPoint showing the problem so we can help.

It works!!!!... It's incredible :D... Thanks for your help Oxy, now, I can continue with my app.

Bye.