fail to hide a sheet

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • 6.0.0
    • Affects Version/s: 5.9.0, 5.12.2
    • Component/s: None
    • Security Level: Jimmy
    • None
    • None

      Steps to Reproduce

      1. 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

      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());
      		}
      	}
      

        1. keikai-834.xlsx
          10 kB
        2. keikai-834.zul
          0.4 kB
        3. Kk834Composer.java
          1 kB

            Assignee:
            Unassigned
            Reporter:
            hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: