/** * Creates rows for the inner tables for each field inside this columsn definition * * @return a List of created AccountingLineTableRows */ protected List<AccountingLineTableRow> createRowsForFields() { List<AccountingLineTableRow> rows = new ArrayList<AccountingLineTableRow>(); int countForThisRow = 0; AccountingLineTableRow row = new AccountingLineTableRow(); for (AccountingLineViewField field : fields) { row.addCell(createHeaderCellForField(field)); row.addCell(createCellForField(field)); countForThisRow += 1; if (countForThisRow == definition.getColumnCount()) { rows.add(row); countForThisRow = 0; row = new AccountingLineTableRow(); } } if (countForThisRow > 0) { // oops! we stopped mid-row and now need to fill it out while (countForThisRow < definition.getColumnCount()) { row.addCell(createPaddingCell()); countForThisRow += 1; } rows.add(row); } return rows; }
/** * Joins the given row and header * * @see * org.kuali.kfs.sys.document.web.TableJoining#joinRow(org.kuali.kfs.sys.document.web.AccountingLineTableRow, * org.kuali.kfs.sys.document.web.AccountingLineTableRow) */ public void joinRow(AccountingLineTableRow headerLabelRow, AccountingLineTableRow row) { if (row != null) { headerLabelRow.addCell(getLabelCell()); row.addCell(getPlaceHoldingCell()); } else { headerLabelRow.addCell(getPlaceHoldingCell()); } }
/** * Joins the header row with a line filling cell, which includes within it an inner table that * shows all the child fields * * @see * org.kuali.kfs.sys.document.web.TableJoining#joinRow(org.kuali.kfs.sys.document.web.AccountingLineTableRow, * org.kuali.kfs.sys.document.web.AccountingLineTableRow) */ public void joinRow(AccountingLineTableRow headerLabelRow, AccountingLineTableRow row) { AccountingLineTableCell cell = new AccountingLineTableCell(); AccountingLineTable columnsTable = new AccountingLineTable(); List<AccountingLineTableRow> rows = createRowsForFields(); columnsTable.setRows(rows); cell.addRenderableElement(columnsTable); headerLabelRow.addCell(cell); }
/** * Has child rows populate with the tab index * * @see org.kuali.kfs.sys.document.web.RenderableElement#populateWithTabIndexIfRequested(int) */ public void populateWithTabIndexIfRequested(int reallyHighIndex) { for (AccountingLineTableRow row : contentRows) { row.populateWithTabIndexIfRequested(reallyHighIndex); } }
/** * Checks if all the child rows are hidden; if so, then no point in showing this... * * @see org.kuali.kfs.sys.document.web.RenderableElement#isHidden() */ public boolean isHidden() { for (AccountingLineTableRow row : contentRows) { if (!row.isHidden()) return false; } return true; }
/** * Has child table rows add any fields they know about to the List * * @see org.kuali.kfs.sys.document.web.RenderableElement#appendFields(java.util.List) * <p>KRAD Conversion: Customization of adding the fields - No use of data dictionary */ public void appendFields(List<Field> fields) { for (AccountingLineTableRow row : contentRows) { row.appendFields(fields); } }
/** * Forces all children rows to render themselves * * @param pageContext the pageContext to render to * @param parentTag the tag requesting all this rendering * @throws JspException thrown if something goes wrong */ public void renderChildRows(PageContext pageContext, Tag parentTag) throws JspException { for (AccountingLineTableRow row : contentRows) { row.renderElement(pageContext, parentTag, renderingContext); } }