FR 2778207 Selectable zoom target window

Enable selection of window to zoom to in AD_Ref_Table.
Thanks to Andrea (rnd4) for the contribution
This commit is contained in:
phib 2009-04-23 00:41:28 +00:00
parent 14ed12548b
commit 4bbd214d51
3 changed files with 67 additions and 2 deletions

View File

@ -1293,6 +1293,7 @@ public class VLookup extends JComponent
Object value = getValue();
if (value == null)
value = selectedItem;
int AD_Window_ID = 0;
// If not already exist or exact value
if (zoomQuery == null || value != null)
{
@ -1304,7 +1305,7 @@ public class VLookup extends JComponent
int AD_Reference_ID = ((MLookup)m_lookup).getAD_Reference_Value_ID();
if (AD_Reference_ID != 0)
{
String query = "SELECT kc.ColumnName"
String query = "SELECT kc.ColumnName, rt.AD_Window_ID"
+ " FROM AD_Ref_Table rt"
+ " INNER JOIN AD_Column kc ON (rt.AD_Key=kc.AD_Column_ID)"
+ "WHERE rt.AD_Reference_ID=?";
@ -1319,6 +1320,7 @@ public class VLookup extends JComponent
if (rs.next())
{
keyColumnName = rs.getString(1);
AD_Window_ID = rs.getInt(2);
}
}
catch (Exception e)
@ -1340,7 +1342,8 @@ public class VLookup extends JComponent
zoomQuery.setRecordCount(1); // guess
}
int AD_Window_ID = m_lookup.getZoom(zoomQuery);
if ( AD_Window_ID == 0 )
AD_Window_ID = m_lookup.getZoom(zoomQuery);
//
log.info(m_columnName + " - AD_Window_ID=" + AD_Window_ID
+ " - Query=" + zoomQuery + " - Value=" + value);

View File

@ -0,0 +1,31 @@
-- 22/04/2009 12:25:01
-- Table reference selectable zoom target window
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57270,143,0,19,103,'AD_Window_ID',TO_DATE('2009-04-22 12:25:01','YYYY-MM-DD HH24:MI:SS'),100,'Data entry or display window','D',22,'The Window field identifies a unique Window in the system.','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Window',0,TO_DATE('2009-04-22 12:25:01','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 22/04/2009 12:25:02
-- Table reference selectable zoom target window
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57270 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- 22/04/2009 12:25:03
-- Table reference selectable zoom target window
ALTER TABLE AD_Ref_Table ADD AD_Window_ID NUMBER(10)
;
-- 22/04/2009 12:25:55
-- Table reference selectable zoom target window
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57270,57011,0,103,TO_DATE('2009-04-22 12:25:54','YYYY-MM-DD HH24:MI:SS'),100,'Data entry or display window',0,'D','The Window field identifies a unique Window in the system.','Y','Y','Y','N','N','N','N','N','Window',120,0,TO_DATE('2009-04-22 12:25:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 22/04/2009 12:25:55
-- Table reference selectable zoom target window
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57011 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
alter table
AD_Ref_Table
add constraint
ADWindow_ADRefTable FOREIGN KEY (AD_Window_ID)
references
AD_Window (AD_Window_ID);

View File

@ -0,0 +1,31 @@
-- 22/04/2009 12:25:02
-- Table reference selectable zoom target window
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57270,143,0,19,103,'AD_Window_ID',TO_TIMESTAMP('2009-04-22 12:25:01','YYYY-MM-DD HH24:MI:SS'),100,'Data entry or display window','D',22,'The Window field identifies a unique Window in the system.','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Window',0,TO_TIMESTAMP('2009-04-22 12:25:01','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 22/04/2009 12:25:02
-- Table reference selectable zoom target window
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57270 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- 22/04/2009 12:25:03
-- Table reference selectable zoom target window
ALTER TABLE AD_Ref_Table ADD COLUMN AD_Window_ID NUMERIC(10)
;
-- 22/04/2009 12:25:55
-- Table reference selectable zoom target window
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57270,57011,0,103,TO_TIMESTAMP('2009-04-22 12:25:54','YYYY-MM-DD HH24:MI:SS'),100,'Data entry or display window',0,'D','The Window field identifies a unique Window in the system.','Y','Y','Y','N','N','N','N','N','Window',120,0,TO_TIMESTAMP('2009-04-22 12:25:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 22/04/2009 12:25:55
-- Table reference selectable zoom target window
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57011 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
alter table
AD_Ref_Table
add constraint
ADWindow_ADRefTable FOREIGN KEY (AD_Window_ID)
references
AD_Window (AD_Window_ID);