When I assign "com.extjs.gxt.ui.client.widget.layout.CardLayout" to "com.extjs.gxt.ui.client.widget.CardPanel"
It give me this snippet.
private void initComponents() {
initComponent(getCardPanel_1());
getCardPanel_1().setLayout(new CardLayout());
getCardPanel_1().add(getLogInComposite_1());
getCardPanel_1().add(getMainPageComposite_1());
}
It should auto generate variable for the CardLayout first in important properties window.
Since I need this variable to swap the card latter.
private void initComponents() {
initComponent(getCardPanel_1());
getCardPanel_1().setLayout(getCardLayOut());
getCardPanel_1().add(getLogInComposite_1());
getCardPanel_1().add(getMainPageComposite_1());
}
CardLayout getCardLayOut(){
if( cardLayout == null ){
cardLayout = new CardLayout();
}
return cardLayout;
}
private class LogInCompositeBtnNewButtonSelectionListener extends SelectionListener<ButtonEvent> {
public void componentSelected(final ButtonEvent ce) {
getCardLayOut().setActiveItem(getMainPageComposite_1());
}
}