String onClick = this.onFileClickEventName+"(this);return false;"; nameLink.setOnclick(onClick);
nameLink.setOnclick(onFileClickEventName);
	public UIColumn[] createColumns(String var) {				Vector columns = new Vector();				String imageSize = "16";						if (showColumn(COLUMN_ICON)) {			UIColumn col0 = new UIColumn();			HtmlGraphicImage icon = new HtmlGraphicImage();			icon.setValueBinding("url", WFUtil.createValueBinding("#{"+var+".iconURL}"));			icon.setId(P_ID+"_I");			icon.setHeight("16");// sizes that make sense 16/32/64/128			HtmlCommandLink iconLink = new HtmlCommandLink();			iconLink.setId(P_ID+"_L");						WFUtil.addParameterVB(iconLink, PARAMETER_WEB_DAV_URL, var + ".webDavUrl");			WFUtil.addParameterVB(iconLink, PARAMETER_IS_FOLDER, var + ".isCollection");			iconLink.setActionListener(WFUtil.createMethodBinding("#{"+WebDAVList.WEB_DAV_LIST_BEAN_ID+".processAction}", new Class[]{ActionEvent.class}));			iconLink.getChildren().add(icon);			col0.getChildren().add(iconLink);						columns.add(col0);		}				if (showColumn(COLUMN_NAME)) {			UIColumn col = new UIColumn();			HtmlCommandLink nameSortLink = new HtmlCommandLink();			HtmlOutputText nameSortText = ContentBlock.getBundle().getLocalizedText("name");			if (SORT_BY_NAME.equals(this.sorter)) {				nameSortText.setStyleClass("wf_listheaderlink_clicked");				nameSortLink.getAttributes().put(ACTION_SORT, SORT_BY_NAME_DESC);			} else if (SORT_BY_NAME_DESC.equals(this.sorter)) {				nameSortText.setStyleClass("wf_listheaderlink_clicked_descending");				nameSortLink.getAttributes().put(ACTION_SORT, SORT_BY_NAME);			} else {				nameSortText.setStyleClass("wf_listheaderlink");				nameSortLink.getAttributes().put(ACTION_SORT, SORT_BY_NAME);			}			nameSortLink.getChildren().add(nameSortText);			nameSortLink.setActionListener(WFUtil.createMethodBinding("#{"+WebDAVList.WEB_DAV_LIST_BEAN_ID+".processAction}", new Class[]{ActionEvent.class}));			nameSortLink.setId(P_ID+"_sortName");			col.setHeader(nameSortLink);						//NameLink for file			HtmlOutputLink nameLink = new HtmlOutputLink();						if (this.onFileClickEventName != null) {				// Temporary hardcoding (this.href) to the onclick				String onClick = this.onFileClickEventName+"(this);return false;";				nameLink.setOnclick(onClick);			}			nameLink.setValueBinding("value", WFUtil.createValueBinding("#{"+ var + ".encodedURL}"));			nameLink.setId(P_ID+"_fi");			nameLink.setStyleClass("wf_listlink");			nameLink.getChildren().add(WFUtil.getTextVB(var + ".name"));			nameLink.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isFile}"));						//NameLink for folder			HtmlCommandLink nameFolderLink = new HtmlCommandLink();			nameFolderLink.setId(P_ID);			nameFolderLink.setStyleClass("wf_listlink");			nameFolderLink.setValueBinding("value", WFUtil.createValueBinding("#{"+var + ".name}"));			nameFolderLink.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isCollection}"));			WFUtil.addParameterVB(nameFolderLink, PARAMETER_WEB_DAV_URL, var + ".webDavUrl");			WFUtil.addParameterVB(nameFolderLink, PARAMETER_IS_FOLDER, var + ".isCollection");			nameFolderLink.setActionListener(WFUtil.createMethodBinding("#{"+WebDAVList.WEB_DAV_LIST_BEAN_ID+".processAction}", new Class[]{ActionEvent.class}));						// DetailLink			HtmlCommandLink nameDetailsLink = new HtmlCommandLink();			nameDetailsLink.setId(P_ID+"_det");			nameDetailsLink.setStyleClass("content_viewer_file_details");			nameDetailsLink.getAttributes().put(ContentViewer.PARAMETER_ACTION, ContentViewer.ACTION_FILE_DETAILS);			nameDetailsLink.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isFile}"));			nameDetailsLink.setValueBinding("alt", ContentBlock.getBundle().getValueBinding("document_details"));			nameDetailsLink.setValueBinding("title", ContentBlock.getBundle().getValueBinding("document_details"));						WFUtil.addParameterVB(nameDetailsLink, PARAMETER_WEB_DAV_URL, var + ".webDavUrl");			WFUtil.addParameterVB(nameDetailsLink, PARAMETER_IS_FOLDER, var + ".isCollection");			nameDetailsLink.setActionListener(WFUtil.createMethodBinding("#{"+WebDAVList.WEB_DAV_LIST_BEAN_ID+".processAction}", new Class[]{ActionEvent.class}));			// PreviewLink//			HtmlCommandLink namePreviewLink = new HtmlCommandLink();			HtmlOutputLink namePreviewLink = new HtmlOutputLink();						namePreviewLink.setId(P_ID+"_pre");			namePreviewLink.setValueBinding("value", WFUtil.createValueBinding("#{"+ var + ".previewActionURI}"));			//"document_details"			namePreviewLink.setStyleClass("content_viewer_file_preview");			//namePreviewLink.getAttributes().put(ContentViewer.PARAMETER_ACTION, ContentViewer.ACTION_PREVIEW);			namePreviewLink.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isFile}"));			//WFUtil.addParameterVB(namePreviewLink, PARAMETER_WEB_DAV_URL, var + ".webDavUrl");			//WFUtil.addParameterVB(namePreviewLink, PARAMETER_IS_FOLDER, var + ".isCollection");			//namePreviewLink.setActionListener(WFUtil.createMethodBinding("#{"+WebDAVList.WEB_DAV_LIST_BEAN_ID+".processAction}", new Class[]{ActionEvent.class}));			namePreviewLink.setValueBinding("alt", ContentBlock.getBundle().getValueBinding("preview"));			namePreviewLink.setValueBinding("title", ContentBlock.getBundle().getValueBinding("preview"));						HtmlOutputLink permissionLink = new HtmlOutputLink();			permissionLink.setId(P_ID+"_per");			permissionLink.setValueBinding("value", WFUtil.createValueBinding("#{"+ var + ".permissionActionURI}"));			permissionLink.setStyleClass("content_viewer_file_permissions");			permissionLink.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".renderPermissionLink}"));			permissionLink.setValueBinding("alt", ContentBlock.getBundle().getValueBinding("permissions"));			permissionLink.setValueBinding("title", ContentBlock.getBundle().getValueBinding("permissions"));									col.getChildren().add(nameLink);			col.getChildren().add(nameFolderLink);						UIColumn col2 = new UIColumn();			HtmlOutputText emptyText = WFUtil.getText(" ", "wf_listtext");			emptyText.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isCollection}"));			col2.getChildren().add(namePreviewLink);			col2.getChildren().add(nameDetailsLink);			col2.getChildren().add(permissionLink);			col2.getChildren().add(emptyText);			columns.add(col);			columns.add(col2);					}		//		UIColumn col2 = new UIColumn();//		col2.setHeader(ContentBlock.getBundle().getLocalizedText("created"));//		HtmlOutputText creation = WFUtil.getTextVB(var + ".creationDate");//		creation.setStyleClass("wf_listtext");//		col2.getChildren().add(creation);				if (showColumn(COLUMN_SIZE)) {			UIColumn col3 = new UIColumn();			HtmlCommandLink sizeSortLink = new HtmlCommandLink();			HtmlOutputText sizeSortText = ContentBlock.getBundle().getLocalizedText("size");			if (SORT_BY_SIZE.equals(this.sorter)) {				sizeSortText.setStyleClass("wf_listheaderlink_clicked");				sizeSortLink.getAttributes().put(ACTION_SORT, SORT_BY_SIZE_DESC);			} else if (SORT_BY_SIZE_DESC.equals(this.sorter)) {				sizeSortText.setStyleClass("wf_listheaderlink_clicked_descending");				sizeSortLink.getAttributes().put(ACTION_SORT, SORT_BY_SIZE);			} else {				sizeSortText.setStyleClass("wf_listheaderlink");				sizeSortLink.getAttributes().put(ACTION_SORT, SORT_BY_SIZE_DESC);			}			sizeSortLink.getChildren().add(sizeSortText);			sizeSortLink.setActionListener(WFUtil.createMethodBinding("#{"+WebDAVList.WEB_DAV_LIST_BEAN_ID+".processAction}", new Class[]{ActionEvent.class}));			sizeSortLink.setId(P_ID+"_sortSize");			col3.setHeader(sizeSortLink);			HtmlOutputText size = WFUtil.getTextVB(var + ".length");			size.setStyleClass("wf_listtext");			col3.getChildren().add(size);						columns.add(col3);		}		//		UIColumn col4 = new UIColumn();//		col4.setHeader(ContentBlock.getBundle().getLocalizedText("mime_type"));//		HtmlOutputText mime = WFUtil.getTextVB(var + ".mime");//		mime.setStyleClass("wf_listtext");//		col4.getChildren().add(mime);				if (showColumn(COLUMN_VERSION)) {			UIColumn col5 = new UIColumn();			col5.setHeader(ContentBlock.getBundle().getLocalizedText("version"));			HtmlOutputText version = WFUtil.getTextVB(var + ".version");			version.setStyleClass("wf_listtext");			col5.getChildren().add(version);						columns.add(col5);		}				if (showColumn(COLUMN_LOCK)) {			HtmlGraphicImage lock = new HtmlGraphicImage();			lock.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isLocked}"));			lock.setUrl(IWMainApplication.getDefaultIWMainApplication().getURIFromURL(WFUtil.getContentBundle().getResourcesVirtualPath())+"/images/locked.gif");			lock.setId(P_ID+"_lock");			lock.setHeight(imageSize);// sizes that make sense 16/32/64/128			HtmlOutputText emptyText = WFUtil.getText(" ", "wf_listtext");			emptyText.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isUnlocked}"));			UIColumn col6 = new UIColumn();			col6.setHeader(ContentBlock.getBundle().getLocalizedText("lock"));			col6.getChildren().add(lock);			col6.getChildren().add(emptyText);						columns.add(col6);		}				if (showColumn(COLUMN_CHECKOUT)) {			UIColumn col7 = new UIColumn();			col7.setHeader(ContentBlock.getBundle().getLocalizedText("checked_out"));			HtmlOutputText checkedOut = WFUtil.getTextVB(var + ".comment");			checkedOut.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".checkedOut}"));			checkedOut.setStyleClass("wf_listtext");			col7.getChildren().add(checkedOut);						HtmlOutputText emptyText = WFUtil.getText(" ", "wf_listtext");//			emptyText.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isCollection}"));			col7.getChildren().add(emptyText);						columns.add(col7);		}				if (showColumn(COLUMN_LAST_MODIFIED)) {			UIColumn col8 = new UIColumn();			HtmlCommandLink modSortLink = new HtmlCommandLink();			HtmlOutputText modSortText = ContentBlock.getBundle().getLocalizedText("last_modified");			if (SORT_BY_MODIFICATION_DATE.equals(this.sorter)) {				modSortText.setStyleClass("wf_listheaderlink_clicked");				modSortLink.getAttributes().put(ACTION_SORT, SORT_BY_MODIFICATION_DATE_DESC);			} else if (SORT_BY_MODIFICATION_DATE_DESC.equals(this.sorter)) {				modSortText.setStyleClass("wf_listheaderlink_clicked_descending");				modSortLink.getAttributes().put(ACTION_SORT, SORT_BY_MODIFICATION_DATE);			} else {				modSortText.setStyleClass("wf_listheaderlink");				modSortLink.getAttributes().put(ACTION_SORT, SORT_BY_MODIFICATION_DATE_DESC);			}			modSortLink.getChildren().add(modSortText);			modSortLink.setActionListener(WFUtil.createMethodBinding("#{"+WebDAVList.WEB_DAV_LIST_BEAN_ID+".processAction}", new Class[]{ActionEvent.class}));			modSortLink.setId(P_ID+"_sortMod");			col8.setHeader(modSortLink);			HtmlOutputText modifiedDate = WFUtil.getTextVB(var + ".modifiedDateLong");			modifiedDate.setStyleClass("wf_listtext");			modifiedDate.setConverter(new WFTimestampConverter());			col8.getChildren().add(modifiedDate);						columns.add(col8);		}				if (showColumn(COLUMN_DELETE)) {			UIColumn del = new UIColumn();			del.setHeader(ContentBlock.getBundle().getLocalizedText("delete"));			HtmlCommandLink delLink = new HtmlCommandLink();			delLink.setValueBinding("rendered", WFUtil.createValueBinding("#{"+var+".isReal}"));			delLink.getAttributes().put(ContentViewer.PARAMETER_ACTION, ContentViewer.ACTION_DELETE);			WFUtil.addParameterVB(delLink, ContentViewer.PATH_TO_DELETE, var+".webDavUrl");			delLink.setActionListener(WFUtil.createMethodBinding("#{contentviewerbean.processAction}", new Class[]{ActionEvent.class}));			delLink.setId(P_ID+"_delLink");			HtmlGraphicImage delete = new HtmlGraphicImage();			delete.setUrl(IWMainApplication.getDefaultIWMainApplication().getURIFromURL(WFUtil.getContentBundle().getResourcesVirtualPath())+"/images/delete.gif");			delete.setId(P_ID+"_delete");			delete.setHeight(imageSize);// sizes that make sense 16/32/64/128			delLink.getChildren().add(delete);						del.getChildren().add(delLink);						columns.add(del);		}				return (UIColumn[]) columns.toArray(new UIColumn[]{});//		return new UIColumn[] { col0, col, col3, col5, col6 , col7, col8, del};	}