/** * Set an index to a key area. * @param iKeyArea The key area to set to this index. * @param gridTable The record to set. * @param index The index to relate to this keyarea/gridtable combo. */ public void setGridTable(String keyAreaName, Rec gridTable, int index) { if (index == -1) index = m_iNextArrayIndex; // Next available m_iNextArrayIndex = Math.max(m_iNextArrayIndex, index+1); if (gridTable == null) if (m_gridScreen != null) gridTable = m_gridScreen.getMainRecord(); if (gridTable != null) if (m_gridScreen != null) if (gridTable != m_gridScreen.getMainRecord()) { if (m_gridScreen.getMainRecord() instanceof QueryRecord) { int keyIndex = ((QueryRecord)m_gridScreen.getMainRecord()).setGridFile((Record)gridTable, keyAreaName); // Sets the key order and gridtable (even if only one file) keyAreaName = gridTable.getKeyArea(keyIndex).getKeyName(); } } m_iKeyAreaArray[index] = keyAreaName; } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param gridScreen The grid screen to reselect on change. */ public void init(BaseField field, GridScreenParent gridScreen, GridComponent sPopupBox) { super.init(field); m_gridScreen = gridScreen; m_sPopupBox = sPopupBox; Record gridFile = null; if (gridScreen != null) gridFile = (Record)gridScreen.getMainRecord(); if (gridFile != null) { // Remove this listener when the file closes FileListener listener = new FileRemoveBOnCloseHandler(this); // If this closes first, this will remove FileListener gridFile.addListener(listener); // Remove this if you close the file first } } /**
m_recGrid = (Record)m_gridScreen.getMainRecord(); for (int i = 0; i < m_recGrid.getKeyAreaCount(); i++) if (sField.getConverter().getField() != null) Record record = (Record)m_gridScreen.getMainRecord(); iKeyOrder = -1; // No obvious sort order for (int iKeyArea = 0; iKeyArea < record.getKeyAreaCount(); iKeyArea++) KeyArea keyArea = null; if (m_recGrid == null) m_recGrid = (Record)m_gridScreen.getMainRecord(); keyArea = m_recGrid.setKeyArea(iKeyOrder); if (keyArea == null)