Collaboration Edit

From Documentation

Stop.png This article is out of date, please refer to for more up to date information.

Available in ZK Spreadsheet EE only

ZK Spreadsheet supports Collaboration Edit automatically as long as two or more Spreadsheet UI components share a common book with proper scope.


Share a common book and allow collaboration editing on the book.

The Common Shared Book

Following, we will show you a very typical Excel file. Let us construct an Excel workbook and share it for everyone that visits the page.



Create the Book And Set the Sharing Scope to Application

Import the book and set the book's share scope to APPLICATION. And you are done! ZK Spreadsheet will synchronize information and display other users' focus to show what they are working on at the moment



<window id="mainwin" apply="org.zkoss.zssessentials.coedit.CoeditComposer" width="100%" vflex="1">
    <spreadsheet id="ss"


This composer prepares the singleton book, set its shareScope to APPLICATION and associate the book with the spreadsheet UI component.

package org.zkoss.zssessentials.coedit;
public class CoeditComposer extends GenericForwardComposer {
	private static Book book = null;
	private Spreadsheet ss;
	public void doAfterCompose(Component comp) throws Exception {
		synchronized (CoeditComposer.class) {
			if (book == null) { //initialize the shared Book
				final Importer importer = Importers.getImporter("excel");
				final InputStream is = Sessions.getCurrent().getWebApp().getResourceAsStream("/WEB-INF/excel/coedit/simple.xlsx");
				book = importer.imports(is, "simple.xlsx");
				book.setShareScope(EventQueues.APPLICATION); //share the work book in Application Scope


Open a browser to visit the coedit.zul page and then open another browser to visit the same coedit.zul page. As two browsers share the same simple.xlsx book in APPLICATION scope, any change made from one browser will reflect on the other. Note that the orange box shows the other user's focus and his/her current status at another browser.


View complete source of ZUML coedit.zul

View complete source of composer

Version History

Last Update : 2022/01/19

Version Date Content
Since 2.2.0 January, 2012 Support coediting

All source code listed in this book is at Github.

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