Hyperlink Event"

From Documentation
Line 25: Line 25:
 
info.append("Hyperlink ").append(event.getType())
 
info.append("Hyperlink ").append(event.getType())
 
.append(" on : ")
 
.append(" on : ")
.append(Ranges.getCellReferenceString(event.getRow(),event.getColumn()))
+
.append(Ranges.getCellRefString(event.getRow(),event.getColumn()))
 
.append(", address : ").append(event.getAddress());
 
.append(", address : ").append(event.getAddress());
 
 

Revision as of 00:55, 21 August 2013



Available in ZK Spreadsheet EE only

Overview

There are one hyperlink event that ZK Spreadsheet supports.

  • onHyperlink
    This event is fired when a user clicks a hyperlink in a cell. When a corresponding event listener is invoked, a HyperlinkEvent object is passed as an argument.

Event Monitor Example

The Event Monitor application's screenshot when we click the link http://www.zkoss.org in A7.

Zss-essentials-events-hyperlink.png


public class EventsComposer extends SelectorComposer<Component>{
	//omitted codes...

	@Listen("onCellHyperlink = #ss")
	public void onCellHyperlink(CellHyperlinkEvent event){
		StringBuilder info = new StringBuilder();
		
		info.append("Hyperlink ").append(event.getType())
			.append(" on : ")
			.append(Ranges.getCellRefString(event.getRow(),event.getColumn()))
			.append(", address : ").append(event.getAddress());
		
		//show info...
	}		

}
  • Line 11: We can get the clicked hyperlink address.



All source code listed in this book is at Github.


Last Update : 2013/08/21

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.