Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-367

Attribute "ctrlKeys" doesn't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.0.0 RC
    • 3.0.0 RC
    • ZSS Component
    • None

      Problem Description:

      set ctrlKeys attribute to ^a, but pressing ctrl+a doesn't sent onCtrlKey event.

      Reproducing Step:

      <window hflex="1" vflex="1"
      		apply="org.zkoss.zss.essential.EventsComposer">
      			<spreadsheet id="ss" hflex="1" vflex="1"
      			 maxVisibleRows="100" maxVisibleColumns="40"
      			ctrlKeys="^a"/>
      </window>
      
      public class EventsComposer extends SelectorComposer<Component>{
      
      	@Listen("onCtrlKey = spreadsheet")
      	public void onCtrlKey(KeyEvent event){
      		
      		System.out.println(event.getKeyCode());
      	}
      }
      

      Root Cause:

      in Spreadsheet.java, below code set ctrlKeys back to default value.

      	private void reloadUserActionEventRegisteration() {
      		...
      			String ctrlKeys = ua.getCtrlKeys();
      			if(ctrlKeys!=null){//null, don't set, keep the original
      				this.setCtrlKeys(ctrlKeys);
      			}
      		...
      	}
      

            dennis dennis
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: