public Table getListTable(IWContext iwc) throws RemoteException { Table table = new Table(2, this.USERS_PER_PAGE + 1); table.setCellspacing(0); table.setCellpadding(2); table.setWidth(Table.HUNDRED_PERCENT); table.setHorizontalZebraColored( IWConstants.DEFAULT_INTERFACE_COLOR, IWConstants.DEFAULT_LIGHT_INTERFACE_COLOR); int row = 1; int rowHeight = 12; table.setHeight(table.getRows() * rowHeight); table.add(getTitleText(localize("user", "User")), 1, row); table.add(getTitleText(localize("personal_id", "Personal ID")), 2, row); table.setRowColor(row, IWConstants.DEFAULT_DARK_INTERFACE_COLOR); table.setHeight(row, rowHeight); if (this.users != null) { /** Calculating page....starts */ int start = this.currentPage * this.USERS_PER_PAGE; Iterator iter = this.users.iterator(); for (int i = 0; i < start; i++) { if (iter.hasNext()) { iter.next(); } } /** Calculating page....ends */ int counter = 0; User user; Link link; String pId; while (iter.hasNext() && counter < this.USERS_PER_PAGE) { ++counter; ++row; table.setHeight(row, rowHeight); user = (User) iter.next(); pId = user.getPersonalID(); if (pId == null) { pId = "-"; } link = getLink(getText(user.getName()), iwc); link.addParameter(this.PARAMETER_USER_ID, user.getPrimaryKey().toString()); table.add(link, 1, row); table.add(getText(pId), 2, row); } } return table; }
public Table getListTable(IWContext iwc) throws RemoteException { Table table = new Table(3, this.USERS_PER_PAGE + 1); table.setCellspacing(0); table.setCellpadding(2); table.setWidth("100%"); table.setHorizontalZebraColored("#C1C3B4", "#FFFFFF"); int row = 1; int rowHeight = 12; table.setHeight(table.getRows() * rowHeight); table.add(getTitleText(localize("user", "User")), 1, row); table.add(getTitleText(localize("school", "School")), 2, row); table.add(getTitleText(localize("personal_id", "Personal ID")), 3, row); table.setRowColor(row, "#74858D"); table.setHeight(row, rowHeight); if (this.users != null) { int start = this.currentPage * this.USERS_PER_PAGE; Iterator iter = this.users.iterator(); for (int i = 0; i < start; i++) { if (iter.hasNext()) { iter.next(); } } String pId; for (int counter = 0; iter.hasNext() && counter < this.USERS_PER_PAGE; table.add(getText(pId), 3, row)) { counter++; row++; table.setHeight(row, rowHeight); User user = (User) iter.next(); pId = user.getPersonalID(); if (pId == null) { pId = "-"; } Link link = getLink(getText(user.getName()), iwc); link.addParameter(this.PARAMETER_USER_ID, user.getPrimaryKey().toString()); table.add(link, 1, row); table.add(getText(getSchoolName(user)), 2, row); } } return table; }