Menu

#80 WizardPanel bug

GWTCOMP
open
GWTCOMP (12)
7
2012-12-17
2010-08-16
No

An user has reported the following:

WizardPanel class on the org.cafesip.gwtcomp.client.ui package

Focus on this function :

/**
* Inserts a panel to the "deck" at a given position.
*
* @param name
* name of the panel
* @param panel
* the panel itself
* @param atPosition
* position at which the panel is inserted (starting with 0).
*/
public void addPanel(String name, Panel panel, int atPosition)
{
panelList.add(atPosition, name); /* Add at the specify position */
this.panel.add(panel); /* Add the panel at the end */
}

Therefore when you switch panel, you will not get the right panel :

private void switchPage()
{
panel.showWidget(currentIndex); /* Here the error */
/*
displayPanel(panelList.get(currentIndex)); should be better ?
*/
enableButtons();

Iterator<WizardPanelListener> i = listeners.iterator();
String name = getDisplayedPanel();
while (i.hasNext())
{
WizardPanelListener listener = i.next();
listener.onPageSwitch(name);
}
}

Discussion

MongoDB Logo MongoDB