[izpack-devel] Possible Bug With navigatePrevious()

Hal Vaughan hal at thresholddigital.com
Sat Jan 21 13:52:09 CET 2006


I'm not sure if this is a bug, but I wanted to ask if anyone has experienced 
similar problems, or if I'm missing something obvious.

I have a series of cooperative panels and, while I'm testing them, I've got 
them right after the HelloPanel.  For this series of panels, some panels are 
needed in some cases, others are needed in other cases, so in no instance 
does the end user go through all these panels.  I am trying to make it so if 
the end user clicks on "Previous" from ANY of these panels, instead of going 
back one panel at a time, it will automatically go back through all the 
panels to the first one in the series.

To do this, I store a variable in InstallData.  This lets me keep track of the 
current panel in my series.  When "Previous" is pressed, as each panel is 
activated, it checks to see if the current panel is one AFTER itself in the 
series.  if so, it knows the end user is moving backwards, and does 2 things:
1) It calls skipPanel() so it is not displayed, and
2) It calls navigatePrevious()
This way the panel does not appear and any panels before the first in the 
series are skipped over, on the way back to the first panel in my series.

The first panel is never skipped and always activated -- there is no call 
anywhere in that class to the method skipPanel().  However, whenever I click 
Previous and other panels are skipped, the first in the series is also 
skipped -- taking me straight back to the Hello Panel.

I've used a println to check and I can see that each panel is passed through 
and the first in the series is activated, but it never appears when moving 
backward.  It is skipped over -- all the time.

I experimented and found that if I do not skip the 2nd panel in the series 
(and remember, this is moving packwards), the 1st panel will appear.

I've started looking at the code for this, and have more to study, but it 
seems like at some point, if you're skipping a panel going backwards, that 
the counter for skipPanel() gets out of sync with which panel is being 
displayed.

I will look into this more, but I wanted to post this for feedback and 
comments if anyone has had similar problems or know something obvious I 
missed that I'm doing wrong.

Thanks for any feedback.

Hal



More information about the izpack-devel mailing list