PDA

View Full Version : [SOLVED] Content Panel : Add or refresh content



valery.stroeder
16 Nov 2009, 2:32 AM
Hello,

using demo samples, I'm creating a little web application.



I have a borderLayout like this : http://www.extjs.com/examples-dev/explorer.html#borderlayout (http://www.extjs.com/forum/../examples-dev/explorer.html#borderlayout)
I have 2 rowEditorGrid like this : http://www.extjs.com/examples-dev/explorer.html#roweditorgrid (http://www.extjs.com/forum/../examples-dev/explorer.html#roweditorgrid)
In the EntryPoint's class I put my 2 rowGridEditors in the borderLayout's center region and then I set it unvisible



mainPanel.getCenter().add(foodPanel);
mainPanel.getCenter().add(mealPanel);

foodPanel.setVisible(false);
mealPanel.setVisible(false);


In the west's region I have some buttons to display one of another panel



btnfood.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(final ButtonEvent buttonEvent) {
CRC.mealPanel.setVisible(false);
CRC.foodPanel.setVisible(true);
}
});
...
So I'm abble to display a grid or another pressing different buttons. But If I add informations in my grid after the first grid's display. The new datas are never displayed.. Samething if I try to add other datas to the center's panel..



btnfood.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(final ButtonEvent buttonEvent) {
CRC.mealPanel.setVisible(false);
CRC.mainPanel.getCenterPanel().addText("Hello?????????????????????");
CRC.foodPanel.setVisible(true);
}
});
Hello text never appear, any idea ?

Thanks.

takayser
17 Nov 2009, 3:16 AM
Hello text never appear, any idea ?try (after you add your text)

CRC.mainPanel.getCenterPanel().layout();or (before you add your text)

CRC.mainPanel.getCenterPanel().setLayoutOnChange(true);

sven
17 Nov 2009, 4:47 AM
It is always better to manually call layout for performance reasons. This way you can make a lot of changes and only have one layoutcall

valery.stroeder
20 Nov 2009, 6:33 AM
Thank you both for your answers.
It was exactly what I was searching for.

Thanks thanks thans :D

PS : Is there a way to mark this thread as resolved ?

Arno.Nyhm
20 Nov 2009, 7:02 AM
if you click on edit and then on go advanced in your first posting you can change the subject to "[SOLVED]"