String text = selectedIter.next().toString();
String categoryKey = selectedIter.next().toString();
	private Table getCategoriesTable(String resourcePath) {		Table categoriesTable = new Table();				IWContext iwc = IWContext.getInstance();		WebDAVMetadataResource resource;		int count = 0;		try {			//Get all the selected categories for this article and display them as selected			resource = (WebDAVMetadataResource) IBOLookup.getSessionInstance(					iwc, WebDAVMetadataResource.class);			Collection selectedCategories = resource.getCategories(resourcePath);			if(selectedCategories!=null){				Iterator selectedIter = selectedCategories.iterator();				while(selectedIter.hasNext()) {					String text = selectedIter.next().toString();					//Checkbox					HtmlSelectBooleanCheckbox smc = new HtmlSelectBooleanCheckbox();					smc.setValue(new Boolean(true));					String id = CATEGORY+count;	//				System.out.println("CATEGORY-COMPONENT-ID:"+id);					smc.setId(id);					smc.getAttributes().put(RESOURCE_PATH,resourcePath);					categoriesTable.add(smc,count%COLLUMNS + 1,count/COLLUMNS + 1);					//Text					HtmlOutputText catText = new HtmlOutputText();					catText.setValue(text);					categoriesTable.add(catText,count%COLLUMNS + 1,count/COLLUMNS + 1);					count++;				}			}			//Display all the non-selected categories			Iterator nonSelectedIter = CategoryBean.getInstance().getCategories().iterator();			while(nonSelectedIter.hasNext()) {				Object nonSel = nonSelectedIter.next();				if(selectedCategories == null || !selectedCategories.contains(nonSel)) {					String text = nonSel.toString();					//Checkbox					HtmlSelectBooleanCheckbox smc = new HtmlSelectBooleanCheckbox();					smc.setValue(new Boolean(false));					String id = CATEGORY+count;//					System.out.println("CATEGORY-COMPONENT-ID:"+id);					smc.setId(id);					smc.getAttributes().put(RESOURCE_PATH,resourcePath);					categoriesTable.add(smc,count%COLLUMNS + 1,count/COLLUMNS + 1);					//Text					HtmlOutputText catText = new HtmlOutputText();					catText.setValue(text);					categoriesTable.add(catText,count%COLLUMNS + 1,count/COLLUMNS + 1);					count++;				}			}			count--;			//Add the save button			if(resourcePath!=null && resourcePath.length()>0) {				WFResourceUtil localizer = WFResourceUtil.getResourceUtilContent();				HtmlCommandButton addCategoryButton = localizer.getButtonVB(SAVE_ID, "save", this);				categoriesTable.add(addCategoryButton,1,count/COLLUMNS + 2);			}						categoriesTable.setColumns(Math.min(count+1,COLLUMNS));			categoriesTable.setRows(count/COLLUMNS + 2);			categoriesTable.setId(categoriesTable.getId() + "_ver");//			categoriesTable.setRowStyleClass(1,"wf_listheading");			categoriesTable.setStyleClass("wf_listtable");		}		catch (IBOLookupException e) {			e.printStackTrace();		}		catch (RemoteException e) {			e.printStackTrace();		}		catch (IOException e) {			e.printStackTrace();		}				return categoriesTable;	}