-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Normal
-
Affects Version/s: 5.9.0, 5.12.2
-
Component/s: None
-
Security Level: Jimmy
-
None
-
None
Steps to Reproduce
- click the button to hide the selected sheet
@Listen(Events.ON_CLICK + "= #hide") public void hideCurrentSheet(){ Ranges.range(spreadsheet.getSelectedSheet()).setSheetVisible(Range.SheetVisible.HIDDEN); }
Current Result
the selected sheet tab is hidden but its sheet content is still visible
Expected Result
both sheet tab and content should be hidden
Debug Information
- since 6.0.0, fixed by
KEIKAI-668
Workaround
public void selectNextVisibleSheet(Spreadsheet spreadsheet, Sheet selectedSheet) { Book book = spreadsheet.getBook(); int index = book.getSheetIndex(selectedSheet); Sheet newSelectedSheet = null; // from selected index to the last for (int i = index + 1; i < book.getNumberOfSheets(); i++) { Sheet sheet = book.getSheetAt(i); if (!sheet.isHidden()) { newSelectedSheet = sheet; } } if (newSelectedSheet != null) { spreadsheet.setSelectedSheet(newSelectedSheet.getSheetName()); return; } // from selected index to the first for (int i = index - 1; i >= 0; i--) { Sheet sheet = book.getSheetAt(i); if (!sheet.isHidden()) { newSelectedSheet = sheet; } } if (newSelectedSheet != null) { spreadsheet.setSelectedSheet(newSelectedSheet.getSheetName()); } }