diff --git a/db/ddlutils/oracle/views/AD_FIELD_V.sql b/db/ddlutils/oracle/views/AD_FIELD_V.sql
index a3d519f0ac..59579b3b41 100644
--- a/db/ddlutils/oracle/views/AD_FIELD_V.sql
+++ b/db/ddlutils/oracle/views/AD_FIELD_V.sql
@@ -24,7 +24,7 @@ CREATE OR REPLACE VIEW AD_FIELD_V AS
f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines,
COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
- c.FormatPattern
+ c.FormatPattern, f.IsDefaultFocus
FROM AD_FIELD f
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
diff --git a/db/ddlutils/oracle/views/AD_FIELD_VT.sql b/db/ddlutils/oracle/views/AD_FIELD_VT.sql
index 078ea01e23..537200d0c0 100644
--- a/db/ddlutils/oracle/views/AD_FIELD_VT.sql
+++ b/db/ddlutils/oracle/views/AD_FIELD_VT.sql
@@ -23,7 +23,7 @@ CREATE OR REPLACE VIEW AD_FIELD_VT AS
f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines,
COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
- c.FormatPattern
+ c.FormatPattern, f.IsDefaultFocus
FROM AD_FIELD f
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
diff --git a/db/ddlutils/postgresql/views/AD_FIELD_V.sql b/db/ddlutils/postgresql/views/AD_FIELD_V.sql
index 897aa1bdaa..087f24e6a0 100644
--- a/db/ddlutils/postgresql/views/AD_FIELD_V.sql
+++ b/db/ddlutils/postgresql/views/AD_FIELD_V.sql
@@ -20,7 +20,7 @@ CREATE OR REPLACE VIEW ad_field_v AS
f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines,
COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
- c.FormatPattern
+ c.FormatPattern, f.IsDefaultFocus
FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
diff --git a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql
index 9e0d1fd25f..23cf8768b8 100644
--- a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql
+++ b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql
@@ -16,7 +16,7 @@ CREATE OR REPLACE VIEW ad_field_vt AS
f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines,
COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
- c.FormatPattern
+ c.FormatPattern, f.IsDefaultFocus
FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
diff --git a/migration/i1.0c-release/oracle/201307291518_IDEMPIERE-1149.sql b/migration/i1.0c-release/oracle/201307291518_IDEMPIERE-1149.sql
new file mode 100644
index 0000000000..1ffe240a93
--- /dev/null
+++ b/migration/i1.0c-release/oracle/201307291518_IDEMPIERE-1149.sql
@@ -0,0 +1,291 @@
+-- Jul 25, 2013 5:46:56 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Element (ColumnName,AD_Element_ID,Name,PrintName,AD_Element_UU,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive,AD_Client_ID,EntityType) VALUES ('IsDefaultFocus',202572,'Default Focus','Default Focus','1051f0e7-7bfa-4cab-828f-93fa8ac1c153',TO_DATE('2013-07-25 17:46:54','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2013-07-25 17:46:54','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y',0,'D')
+;
+
+-- Jul 25, 2013 5:46:56 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=202572 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
+;
+
+-- Jul 25, 2013 5:47:21 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,AD_Element_ID,IsSecure) VALUES (0,'N',0,107,210664,'Y','N','N',0,'N',1,'N',20,'N','N','Y','eae0eb7c-9356-4be1-afb3-73662e709474','Y','IsDefaultFocus','N','Default Focus','Y',TO_DATE('2013-07-25 17:47:20','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2013-07-25 17:47:20','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N',202572,'N')
+;
+
+-- Jul 25, 2013 5:47:21 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=210664 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
+;
+
+-- Jul 25, 2013 5:47:28 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+ALTER TABLE AD_Field ADD IsDefaultFocus CHAR(1) DEFAULT 'N' CHECK (IsDefaultFocus IN ('Y','N')) NOT NULL
+;
+
+-- Jul 25, 2013 5:48:40 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,XPosition,AD_Client_ID,ColumnSpan) VALUES ('N',107,1,'N','N',210664,400,'Y',202341,'N','D','Default Focus','1cb6cbd3-9e4f-4586-a00d-b4415fbfb024','Y','N',100,0,TO_DATE('2013-07-25 17:48:39','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-07-25 17:48:39','YYYY-MM-DD HH24:MI:SS'),'Y',2,0,2)
+;
+
+-- Jul 25, 2013 5:48:40 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=202341 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=6432
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200275
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=202341
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=200350
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200348
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=200349
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=13425
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=200837
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=54402
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=54401
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=200838
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=200834
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=13424
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=62468
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=53280
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=200836
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=200835
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=136
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=139
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200275
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=202341
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=13425
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=54401
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=54402
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=13424
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=290,IsDisplayedGrid='Y' WHERE AD_Field_ID=62468
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=300,IsDisplayedGrid='Y' WHERE AD_Field_ID=200771
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=310,IsDisplayedGrid='Y' WHERE AD_Field_ID=53280
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=320,IsDisplayedGrid='Y' WHERE AD_Field_ID=200837
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=330,IsDisplayedGrid='Y' WHERE AD_Field_ID=200350
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=340,IsDisplayedGrid='Y' WHERE AD_Field_ID=200348
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=350,IsDisplayedGrid='Y' WHERE AD_Field_ID=200838
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=360,IsDisplayedGrid='Y' WHERE AD_Field_ID=200834
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=370,IsDisplayedGrid='Y' WHERE AD_Field_ID=200349
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=380,IsDisplayedGrid='Y' WHERE AD_Field_ID=200835
+;
+
+-- Jul 25, 2013 5:49:43 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=390,IsDisplayedGrid='Y' WHERE AD_Field_ID=200836
+;
+
+CREATE OR REPLACE VIEW AD_FIELD_V AS
+ SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
+ f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
+ f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
+ f.IsEncrypted AS IsEncryptedField, f.ObscureType,
+ c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
+ COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
+ c.IsKey, c.IsParent,
+ COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
+ c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
+ c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
+ COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) AS AD_Val_Rule_ID, c.AD_Process_ID,
+ COALESCE(f.Isalwaysupdateable , C.Isalwaysupdateable) As Isalwaysupdateable,
+ COALESCE(f.Readonlylogic, c.Readonlylogic ) As Readonlylogic,
+ COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic,
+ COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.IsEncrypted AS IsEncryptedColumn,
+ c.IsSelectionColumn,
+ tbl.TableName, c.ValueMin, c.ValueMax,
+ fg.NAME AS FieldGroup, vr.Code AS ValidationCode,
+ f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
+ COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
+ c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
+ f.isdisplayedgrid,
+ f.seqnogrid,
+ c.seqnoselection, f.xposition, f.columnspan, f.numlines,
+ COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
+ c.FormatPattern, f.IsDefaultFocus
+FROM AD_FIELD f
+ INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
+ LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
+ LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
+ INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
+ LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
+WHERE f.IsActive = 'Y'
+ AND c.IsActive = 'Y';
+
+CREATE OR REPLACE VIEW AD_FIELD_VT AS
+ SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
+ trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
+ f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
+ f.IsEncrypted AS IsEncryptedField, f.ObscureType,
+ c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
+ COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
+ c.IsKey, c.IsParent,
+ COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
+ c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
+ c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
+ COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) as AD_Val_Rule_ID, c.AD_Process_ID,
+ COALESCE(f.Isalwaysupdateable , C.Isalwaysupdateable) As Isalwaysupdateable,
+ COALESCE(f.Readonlylogic, c.Readonlylogic ) As Readonlylogic,
+ COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic,
+ COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
+ tbl.TableName, c.ValueMin, c.ValueMax,
+ fgt.NAME AS FieldGroup, vr.Code AS ValidationCode,
+ f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
+ COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
+ c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
+ f.isdisplayedgrid,
+ f.seqnogrid,
+ c.seqnoselection, f.xposition, f.columnspan, f.numlines,
+ COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
+ c.FormatPattern, f.IsDefaultFocus
+ FROM AD_FIELD f
+ INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
+ INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
+ LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
+ LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON
+ (f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE)
+ LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
+ INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
+ LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
+ WHERE f.IsActive = 'Y'
+ AND c.IsActive = 'Y';
+
+SELECT register_migration_script('201307291518_IDEMPIERE-1149.sql') FROM dual
+;
\ No newline at end of file
diff --git a/migration/i1.0c-release/postgresql/201307291518_IDEMPIERE-1149.sql b/migration/i1.0c-release/postgresql/201307291518_IDEMPIERE-1149.sql
new file mode 100644
index 0000000000..e4b08af45c
--- /dev/null
+++ b/migration/i1.0c-release/postgresql/201307291518_IDEMPIERE-1149.sql
@@ -0,0 +1,277 @@
+-- Jul 25, 2013 5:46:56 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Element (ColumnName,AD_Element_ID,Name,PrintName,AD_Element_UU,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive,AD_Client_ID,EntityType) VALUES ('IsDefaultFocus',202572,'Default Focus','Default Focus','1051f0e7-7bfa-4cab-828f-93fa8ac1c153',TO_TIMESTAMP('2013-07-25 17:46:54','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2013-07-25 17:46:54','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y',0,'D')
+;
+
+-- Jul 25, 2013 5:46:56 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=202572 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
+;
+
+-- Jul 25, 2013 5:47:21 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,AD_Element_ID,IsSecure) VALUES (0,'N',0,107,210664,'Y','N','N',0,'N',1,'N',20,'N','N','Y','eae0eb7c-9356-4be1-afb3-73662e709474','Y','IsDefaultFocus','N','Default Focus','Y',TO_TIMESTAMP('2013-07-25 17:47:20','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2013-07-25 17:47:20','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N',202572,'N')
+;
+
+-- Jul 25, 2013 5:47:21 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=210664 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
+;
+
+-- Jul 25, 2013 5:47:28 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+ALTER TABLE AD_Field ADD COLUMN IsDefaultFocus CHAR(1) DEFAULT 'N' CHECK (IsDefaultFocus IN ('Y','N')) NOT NULL
+;
+
+-- Jul 25, 2013 5:48:40 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,XPosition,AD_Client_ID,ColumnSpan) VALUES ('N',107,1,'N','N',210664,400,'Y',202341,'N','D','Default Focus','1cb6cbd3-9e4f-4586-a00d-b4415fbfb024','Y','N',100,0,TO_TIMESTAMP('2013-07-25 17:48:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-07-25 17:48:39','YYYY-MM-DD HH24:MI:SS'),'Y',2,0,2)
+;
+
+-- Jul 25, 2013 5:48:40 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=202341 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=6432
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200275
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=202341
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=200350
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200348
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=200349
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=13425
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=200837
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=54402
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=54401
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=200838
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=200834
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=13424
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=62468
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=53280
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=200836
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=200835
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=136
+;
+
+-- Jul 25, 2013 5:49:26 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=139
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200275
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=202341
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=13425
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=54401
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=54402
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=13424
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=290,IsDisplayedGrid='Y' WHERE AD_Field_ID=62468
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=300,IsDisplayedGrid='Y' WHERE AD_Field_ID=200771
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=310,IsDisplayedGrid='Y' WHERE AD_Field_ID=53280
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=320,IsDisplayedGrid='Y' WHERE AD_Field_ID=200837
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=330,IsDisplayedGrid='Y' WHERE AD_Field_ID=200350
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=340,IsDisplayedGrid='Y' WHERE AD_Field_ID=200348
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=350,IsDisplayedGrid='Y' WHERE AD_Field_ID=200838
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=360,IsDisplayedGrid='Y' WHERE AD_Field_ID=200834
+;
+
+-- Jul 25, 2013 5:49:42 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=370,IsDisplayedGrid='Y' WHERE AD_Field_ID=200349
+;
+
+-- Jul 25, 2013 5:49:43 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=380,IsDisplayedGrid='Y' WHERE AD_Field_ID=200835
+;
+
+-- Jul 25, 2013 5:49:43 PM SGT
+-- IDEMPIERE-1149 Implement SetFocus on field
+UPDATE AD_Field SET SeqNoGrid=390,IsDisplayedGrid='Y' WHERE AD_Field_ID=200836
+;
+
+CREATE OR REPLACE VIEW ad_field_v AS
+ SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id,
+ f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno,
+ f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield,
+ f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat,
+ COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent,
+ COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
+ COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout,
+ COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
+ COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id,
+ COALESCE(f.Isalwaysupdateable , C.Isalwaysupdateable) As Isalwaysupdateable,
+ COALESCE(f.Readonlylogic, c.Readonlylogic ) As Readonlylogic,
+ COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic,
+ COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,
+ c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax,
+ fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault,
+ COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
+ COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
+ f.isdisplayedgrid,
+ f.seqnogrid,
+ c.seqnoselection, f.xposition, f.columnspan, f.numlines,
+ COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
+ c.FormatPattern, f.IsDefaultFocus
+ FROM ad_field f
+ JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
+ LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
+ LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
+ JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
+ LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
+ WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;
+
+CREATE OR REPLACE VIEW ad_field_vt AS
+ SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description,
+ trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly,
+ f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
+ c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
+ COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
+ COALESCE(f.ad_val_rule_id,c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id,
+ COALESCE(f.Isalwaysupdateable,C.Isalwaysupdateable) As Isalwaysupdateable,
+ COALESCE(f.Readonlylogic,c.Readonlylogic) As Readonlylogic,
+ COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic,
+ COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,
+ c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode,
+ f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
+ COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
+ f.isdisplayedgrid,
+ f.seqnogrid,
+ c.seqnoselection, f.xposition, f.columnspan, f.numlines,
+ COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
+ c.FormatPattern, f.IsDefaultFocus
+ FROM ad_field f
+ JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
+ JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
+ LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
+ LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text
+ LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
+ JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
+ LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
+ WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;
+
+SELECT register_migration_script('201307291518_IDEMPIERE-1149.sql') FROM dual
+;
\ No newline at end of file
diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java
index 635aec55e3..779868db6b 100644
--- a/org.adempiere.base/src/org/compiere/model/GridField.java
+++ b/org.adempiere.base/src/org/compiere/model/GridField.java
@@ -80,7 +80,7 @@ public class GridField
/**
*
*/
- private static final long serialVersionUID = -4907605626586089308L;
+ private static final long serialVersionUID = -9086333125844297957L;
/**
* Field Constructor.
@@ -1362,6 +1362,15 @@ public class GridField
return m_vo;
}
+ /**
+ * Default Focus
+ * @return focus
+ */
+ public boolean isDefaultFocus()
+ {
+ return m_vo.IsDefaultFocus;
+ } // isDefaultFocus
+
/**
* Is this a long (string/text) field (over 60/2=30 characters)
* @return true if long field
diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java
index 9619af6d7c..6204846163 100644
--- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java
+++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java
@@ -46,7 +46,7 @@ public class GridFieldVO implements Serializable
/**
*
*/
- private static final long serialVersionUID = -767158053380874050L;
+ private static final long serialVersionUID = 7595228091613559685L;
/**
* Return the SQL statement used for the MFieldVO.create
@@ -182,6 +182,8 @@ public class GridFieldVO implements Serializable
vo.MandatoryLogic = rs.getString (i);
else if (columnName.equalsIgnoreCase("ObscureType"))
vo.ObscureType = rs.getString (i);
+ else if (columnName.equalsIgnoreCase("IsDefaultFocus"))
+ vo.IsDefaultFocus = "Y".equals(rs.getString(i));
//
else if (columnName.equalsIgnoreCase("AD_Reference_Value_ID"))
vo.AD_Reference_Value_ID = rs.getInt(i);
@@ -561,7 +563,8 @@ public class GridFieldVO implements Serializable
public String ReadOnlyLogic = "";
/** Display Obscure */
public String ObscureType = null;
-
+ /** Default Focus */
+ public boolean IsDefaultFocus = false;
/** Lookup Validation code */
public String ValidationCode = "";
@@ -727,6 +730,7 @@ public class GridFieldVO implements Serializable
clone.ReadOnlyLogic = ReadOnlyLogic;
clone.MandatoryLogic = MandatoryLogic;
clone.ObscureType = ObscureType;
+ clone.IsDefaultFocus = IsDefaultFocus;
// Lookup
clone.ValidationCode = ValidationCode;
clone.AD_Reference_Value_ID = AD_Reference_Value_ID;
diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AFocusTraversalPolicy.java b/org.adempiere.ui.swing/src/org/compiere/apps/AFocusTraversalPolicy.java
index 656c16ff77..1b2e38d4f9 100644
--- a/org.adempiere.ui.swing/src/org/compiere/apps/AFocusTraversalPolicy.java
+++ b/org.adempiere.ui.swing/src/org/compiere/apps/AFocusTraversalPolicy.java
@@ -23,6 +23,8 @@ import javax.swing.JTabbedPane;
import javax.swing.JToolBar;
import javax.swing.LayoutFocusTraversalPolicy;
+import org.compiere.grid.VPanel;
+import org.compiere.grid.ed.VEditor;
import org.compiere.swing.CEditor;
@@ -37,7 +39,7 @@ public class AFocusTraversalPolicy extends LayoutFocusTraversalPolicy
/**
*
*/
- private static final long serialVersionUID = 5082175252327849893L;
+ private static final long serialVersionUID = 6803932792562494878L;
/**
* Get singleton
@@ -78,6 +80,26 @@ public class AFocusTraversalPolicy extends LayoutFocusTraversalPolicy
return c;
} // getDefaultComponent
+ /**
+ * Get First Component
+ * @param aContainer container
+ * @return first component to focus
+ */
+ @Override
+ public Component getFirstComponent(Container aContainer)
+ {
+ Component c = null;
+ if (aContainer instanceof VPanel)
+ {
+ VEditor editor = ((VPanel)aContainer).getDefaultFocus();
+ if (editor != null && editor.isReadWrite())
+ c = editor.getFocusableComponent();
+ if (c != null)
+ return c;
+ }
+ return super.getFirstComponent(aContainer);
+ } // getFirstComponent
+
/**
* Determines whether the specified Component
* is an acceptable choice as the new focus owner.
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPanel.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPanel.java
index cb68d44d88..637db33338 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/VPanel.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/VPanel.java
@@ -19,6 +19,7 @@ package org.compiere.grid;
import java.awt.BorderLayout;
import java.awt.Component;
+import java.awt.FocusTraversalPolicy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -36,6 +37,7 @@ import net.miginfocom.layout.LayoutCallback;
import net.miginfocom.swing.MigLayout;
import org.adempiere.plaf.AdempierePLAF;
+import org.compiere.apps.AFocusTraversalPolicy;
import org.compiere.apps.APanel;
import org.compiere.grid.ed.VButton;
import org.compiere.grid.ed.VCheckBox;
@@ -124,6 +126,10 @@ public final class VPanel extends CTabbedPane
private String m_oldFieldGroup = null;
/** Previous Field Group Type */
private String m_oldFieldGroupType = null;
+ /** DefaultFocusField */
+ private VEditor m_defaultFocusField = null;
+ /** Focus Traversal Policy */
+ private static FocusTraversalPolicy s_focusPolicy = null;
//[ 1757088 ]
private java.util.Hashtable m_tablist = new java.util.Hashtable();
private java.util.Hashtable m_tabincludelist = new java.util.Hashtable();
@@ -357,6 +363,16 @@ public final class VPanel extends CTabbedPane
label.setLabelFor(field);
//else if (mField.isCreateMnemonic())
//setMnemonic(editor, mField.getMnemonic());
+
+ // Default Focus
+ if (m_defaultFocusField == null && mField.isDefaultFocus())
+ {
+ m_defaultFocusField = editor;
+ if (s_focusPolicy == null)
+ s_focusPolicy = new AFocusTraversalPolicy();
+ setFocusTraversalPolicy(s_focusPolicy);
+ setFocusTraversalPolicyProvider(true);
+ }
}
} // addField
@@ -728,5 +744,27 @@ public final class VPanel extends CTabbedPane
includedTabList.put(detail.getMTab().getAD_Tab_ID(), detail);
}
+ /**
+ * Get Default Focus Field
+ * @return field if defined
+ */
+ public VEditor getDefaultFocus()
+ {
+ return m_defaultFocusField;
+ } // getDefaultFocus
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ if (m_defaultFocusField != null)
+ {
+ if (m_defaultFocusField.isReadWrite())
+ return m_defaultFocusField.getFocusableComponent().requestFocusInWindow();
+ }
+ return super.requestFocusInWindow();
+ }
} // VPanel
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccount.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccount.java
index 5a35537ad4..85ea4c6678 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccount.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccount.java
@@ -66,7 +66,7 @@ public final class VAccount extends JComponent
/**
*
*/
- private static final long serialVersionUID = -4177614835777620089L;
+ private static final long serialVersionUID = 8918710495283801426L;
/******************************************************************************
* Mouse Listener
@@ -262,6 +262,25 @@ public final class VAccount extends JComponent
{
m_text.requestFocus ();
} // requestFocus
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
/**
* Property Change Listener
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignment.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignment.java
index e13f76437b..4c925c1140 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignment.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAssignment.java
@@ -65,7 +65,7 @@ public class VAssignment extends JComponent
/**
*
*/
- private static final long serialVersionUID = 1362298262975012883L;
+ private static final long serialVersionUID = 4270887524258628077L;
/**
* Mouse Listener
@@ -280,6 +280,25 @@ public class VAssignment extends JComponent
{
m_text.requestFocus ();
} // requestFocus
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
/**************************************************************************
* Set/lookup Value
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBinary.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBinary.java
index 2284c3351c..128a4e6212 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBinary.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBinary.java
@@ -17,6 +17,7 @@
package org.compiere.grid.ed;
import java.awt.Color;
+import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
@@ -46,7 +47,7 @@ public class VBinary extends JButton
/**
*
*/
- private static final long serialVersionUID = 298576564679201761L;
+ private static final long serialVersionUID = -1940719045449193395L;
/**
* Binary Editor
@@ -274,4 +275,13 @@ public class VBinary extends JButton
return m_mField;
}
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusComponent
+
} // VBinary
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VButton.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VButton.java
index 174f8deb28..7793762408 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VButton.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VButton.java
@@ -21,6 +21,7 @@ import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE;
import static org.compiere.model.SystemIDs.REFERENCE_POSTED;
import java.awt.Color;
+import java.awt.Component;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.sql.PreparedStatement;
@@ -61,7 +62,7 @@ public final class VButton extends CButton
/**
*
*/
- private static final long serialVersionUID = 567682963060073664L;
+ private static final long serialVersionUID = 148906133238037062L;
/**
* Constructor
@@ -389,5 +390,14 @@ public final class VButton extends CButton
{
m_savedMnemonic = savedMnemonic;
} // getSavedMnemonic
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
} // VButton
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCheckBox.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCheckBox.java
index 32e14242c1..611fbd7bdd 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCheckBox.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCheckBox.java
@@ -46,7 +46,7 @@ public class VCheckBox extends CCheckBox
/**
*
*/
- private static final long serialVersionUID = -9199643773556184995L;
+ private static final long serialVersionUID = -3840182999009176708L;
/******************************************************************************
* Mouse Listener
@@ -262,5 +262,14 @@ public class VCheckBox extends CCheckBox
{
m_savedMnemonic = savedMnemonic;
} // getSavedMnemonic
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
} // VCheckBox
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java
index 21611aced6..a7e3d061cc 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java
@@ -17,6 +17,7 @@
package org.compiere.grid.ed;
import java.awt.Color;
+import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
@@ -51,7 +52,7 @@ public class VColor extends CButton
/**
*
*/
- private static final long serialVersionUID = 3881508174949938138L;
+ private static final long serialVersionUID = -8272165162228993219L;
/**
* Constructor
@@ -358,4 +359,13 @@ public class VColor extends CButton
m_mTab.setValue("Blue" + add, new BigDecimal(c.getBlue()));
} // setColor
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
+
} // VColor
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java
index 583ed6a446..c13fe4913e 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java
@@ -68,7 +68,7 @@ public class VDate extends JComponent
/**
*
*/
- private static final long serialVersionUID = 5265412413586160999L;
+ private static final long serialVersionUID = 6876765074500243476L;
/*****************************************************************************
* Mouse Listener for Popup Menu
@@ -322,6 +322,25 @@ public class VDate extends JComponent
{
m_text.requestFocus ();
} // requestFocus
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
/**
* Set Editor to value
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditor.java
index 77ab3fa6fe..8f22367df8 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditor.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VEditor.java
@@ -17,6 +17,7 @@
package org.compiere.grid.ed;
import java.awt.Color;
+import java.awt.Component;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeListener;
@@ -102,5 +103,11 @@ public interface VEditor extends CEditor, PropertyChangeListener
* Dispose
*/
public void dispose();
+
+ /**
+ * Get Focusable Component
+ * @return component
+ */
+ public Component getFocusableComponent();
} // VEditor
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VFile.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VFile.java
index 4d69b8a984..6bd97eb14d 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VFile.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VFile.java
@@ -18,6 +18,7 @@ package org.compiere.grid.ed;
import java.awt.BorderLayout;
import java.awt.Color;
+import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent;
@@ -58,7 +59,7 @@ public class VFile extends JComponent
/**
*
*/
- private static final long serialVersionUID = -4665930745414194731L;
+ private static final long serialVersionUID = 1381828235230540932L;
/******************************************************************************
* Mouse Listener for Popup Menu
@@ -377,6 +378,34 @@ public class VFile extends JComponent
return m_field;
} // getField
+ /**
+ * Request Focus
+ */
+ @Override
+ public void requestFocus()
+ {
+ m_text.requestFocus();
+ } // requestFocus
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
+
public void keyPressed(KeyEvent e) {
}
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java
index e3fe8e813c..8d13ec2e29 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java
@@ -17,6 +17,7 @@
package org.compiere.grid.ed;
import java.awt.Color;
+import java.awt.Component;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -45,7 +46,7 @@ public class VImage extends JButton
/**
*
*/
- private static final long serialVersionUID = 368261613546756534L;
+ private static final long serialVersionUID = 2061377580245794385L;
/**
* Image Editor
@@ -256,4 +257,13 @@ public class VImage extends JButton
return m_mField;
}
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
+
} // VImage
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java
index a45e7e5fe4..6ae6998909 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java
@@ -59,7 +59,7 @@ public class VLocation extends JComponent
/**
*
*/
- private static final long serialVersionUID = -288409058154703379L;
+ private static final long serialVersionUID = -8952858645752621513L;
/**
* Mouse Listener for Popup Menu
@@ -295,6 +295,25 @@ public class VLocation extends JComponent
{
m_text.requestFocus ();
} // requestFocus
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
/**
* Property Change Listener
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocator.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocator.java
index 42e541a32b..055eac9123 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocator.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocator.java
@@ -70,7 +70,7 @@ public class VLocator extends JComponent
/**
*
*/
- private static final long serialVersionUID = 1953277256988665242L;
+ private static final long serialVersionUID = -8164788185893073951L;
/**
* Mouse Listener for Popup Menu
@@ -277,6 +277,25 @@ public class VLocator extends JComponent
{
m_text.requestFocus ();
} // requestFocus
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
/**
* Set Editor to value
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java
index 19dfd3e6cc..995598bf86 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java
@@ -108,7 +108,7 @@ public class VLookup extends JComponent
/**
*
*/
- private static final long serialVersionUID = -8609913311212365705L;
+ private static final long serialVersionUID = 3156026335667188091L;
/*****************************************************************************
* Mouse Listener for Popup Menu
@@ -296,6 +296,11 @@ public class VLookup extends JComponent
m_buttonSL.setToolTipText(Msg.getMsg(Env.getCtx(), "ShortListShortListItems"));
ActionMap am = m_combo.getActionMap();
am.put("shortlist", new AbstractAction() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 371998095806934367L;
+
@Override
public void actionPerformed(ActionEvent e) {
actionShortList();
@@ -526,7 +531,9 @@ public class VLookup extends JComponent
*/
public boolean isReadWrite()
{
- return m_combo.isReadWrite();
+ if (m_combo != null)
+ return m_combo.isReadWrite();
+ return true;
} // isReadWrite
/**
@@ -588,7 +595,29 @@ public class VLookup extends JComponent
else
m_text.requestFocus ();
} // requestFocus
-
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search)
+ return m_combo.requestFocusInWindow();
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search)
+ return m_combo;
+ return m_text;
+ } // getFocusComponent
/**
* Set Editor to value
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VMemo.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VMemo.java
index f492f6af45..4b62803468 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VMemo.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VMemo.java
@@ -58,7 +58,7 @@ public class VMemo extends CTextArea
/**
*
*/
- private static final long serialVersionUID = -7168406072766858933L;
+ private static final long serialVersionUID = -1544247709358693141L;
/**
* Mouse Listener
@@ -294,6 +294,15 @@ public class VMemo extends CTextArea
public GridField getField() {
return m_mField;
}
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
private class CInputVerifier extends InputVerifier {
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java
index d20864addf..8a96a17e8a 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java
@@ -75,8 +75,8 @@ public final class VNumber extends JComponent
/**
*
*/
- private static final long serialVersionUID = -1473227631807352033L;
-
+ private static final long serialVersionUID = -1826388236069159130L;
+
/** Number of Columns (12) */
public final static int SIZE = 12;
/** Automatically pop up calculator */
@@ -399,6 +399,25 @@ public final class VNumber extends JComponent
m_text.requestFocus ();
} // requestFocus
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
+
/**
* Property Change Listener
* @param evt event
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java
index f07df934a4..51cf3c35bb 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java
@@ -67,7 +67,7 @@ public class VPAttribute extends JComponent
/**
*
*/
- private static final long serialVersionUID = -1823370077523962901L;
+ private static final long serialVersionUID = 3632142379826093036L;
/**
* Mouse Listener
@@ -492,5 +492,33 @@ public class VPAttribute extends JComponent
if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY))
setValue(evt.getNewValue());
} // propertyChange
+
+ /**
+ * Request Focus
+ */
+ @Override
+ public void requestFocus()
+ {
+ m_text.requestFocus();
+ } // requestFocus
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
} // VPAttribute
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPassword.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPassword.java
index 706cf9124d..da1bae2c78 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPassword.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPassword.java
@@ -16,6 +16,7 @@
*****************************************************************************/
package org.compiere.grid.ed;
+import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
@@ -45,7 +46,7 @@ public final class VPassword extends CPassword
/**
*
*/
- private static final long serialVersionUID = 1659042515884579907L;
+ private static final long serialVersionUID = -5450930268559211811L;
/**
* IDE Bean Constructor for 30 character updateable field
@@ -198,6 +199,15 @@ public final class VPassword extends CPassword
public GridField getField() {
return m_mField;
}
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
@Override
public void focusGained(FocusEvent e) {
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java
index fa92befc8e..c160a22820 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java
@@ -14,6 +14,7 @@
package org.compiere.grid.ed;
import java.awt.BorderLayout;
+import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent;
@@ -50,7 +51,8 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene
/**
*
*/
- private static final long serialVersionUID = -1840246214698245287L;
+ private static final long serialVersionUID = 8092151387928370770L;
+
/** Logger */
private static CLogger log = CLogger.getCLogger(VPaymentEditor.class);
/** Search: The Button to open Editor */
@@ -208,7 +210,9 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene
@Override
public boolean isReadWrite() {
- return m_combo.isReadWrite();
+ if (m_combo != null)
+ return m_combo.isReadWrite();
+ return true;
}
@Override
@@ -232,6 +236,25 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene
if (m_lookup != null)
m_combo.requestFocus ();
}
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_combo.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_combo;
+ } // getFocusComponent
@Override
public void setValue(Object value) {
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VString.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VString.java
index 1ffe8fdc11..16d1f5a1e8 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VString.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VString.java
@@ -57,11 +57,11 @@ import org.compiere.util.Msg;
*/
public final class VString extends CTextField
implements VEditor, ActionListener, FocusListener
-{
+{
/**
*
*/
- private static final long serialVersionUID = 8487860095322876086L;
+ private static final long serialVersionUID = 4537820279343591025L;
/** Max Display Length - 60 */
public static final int MAXDISPLAY_LENGTH = org.compiere.model.GridField.MAXDISPLAY_LENGTH;
@@ -428,4 +428,13 @@ public final class VString extends CTextField
m_obscureFont = new Font("SansSerif", Font.ITALIC, m_stdFont.getSize());
}
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
+
} // VString
\ No newline at end of file
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VText.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VText.java
index 45c132e40b..9f4f568378 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VText.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VText.java
@@ -52,10 +52,11 @@ import org.compiere.util.Msg;
public class VText extends CTextArea
implements VEditor, KeyListener, ActionListener, FocusListener
{
+
/**
*
*/
- private static final long serialVersionUID = 437954563775941704L;
+ private static final long serialVersionUID = 189322325798427286L;
/**
* Mouse Listener
@@ -267,5 +268,14 @@ public class VText extends CTextArea
catch (PropertyVetoException pve) {}
m_setting = false;
}
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
} // VText
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextLong.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextLong.java
index c9d8455de3..2c9411006e 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextLong.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VTextLong.java
@@ -55,12 +55,10 @@ import org.compiere.util.Msg;
public class VTextLong extends CTextPane
implements VEditor, KeyListener, ActionListener, FocusListener
{
- /*****************************************************************************/
-
/**
*
*/
- private static final long serialVersionUID = 6484690202241390248L;
+ private static final long serialVersionUID = 7954461878765188455L;
/**
* Mouse Listener
@@ -277,5 +275,13 @@ public class VTextLong extends CTextPane
m_setting = false;
}
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return this;
+ } // getFocusableComponent
} // VTextLong
\ No newline at end of file
diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VURL.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VURL.java
index 0cfd068661..dbf6d1698a 100644
--- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VURL.java
+++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VURL.java
@@ -64,7 +64,7 @@ public class VURL extends JComponent
/**
*
*/
- private static final long serialVersionUID = -3023749380845372419L;
+ private static final long serialVersionUID = 8055870820325408717L;
/******************************************************************************
* Mouse Listener
@@ -506,5 +506,32 @@ public class VURL extends JComponent
setText(getText()); // obscure
} // focus Lost
+ /**
+ * Request Focus
+ */
+ @Override
+ public void requestFocus()
+ {
+ m_text.requestFocus();
+ } // requestFocus
+
+ /**
+ * Request Focus In Window
+ * @return focus request
+ */
+ @Override
+ public boolean requestFocusInWindow()
+ {
+ return m_text.requestFocusInWindow();
+ } // requestFocusInWindow
+
+ /**
+ * Get Focus Component
+ * @return component
+ */
+ public Component getFocusableComponent()
+ {
+ return m_text;
+ } // getFocusComponent
} // VURL
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java
index b4af00a3d2..03b4a87632 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java
@@ -118,6 +118,11 @@ import org.zkoss.zul.impl.XulElement;
public class ADTabpanel extends Div implements Evaluatee, EventListener,
DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3103263515116231658L;
+
private static final String ON_SAVE_OPEN_PREFERENCE_EVENT = "onSaveOpenPreference";
public static final String ON_POST_INIT_EVENT = "onPostInit";
@@ -126,11 +131,6 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
public static final String ON_DYNAMIC_DISPLAY_EVENT = "onDynamicDisplay";
- /**
- *
- */
- private static final long serialVersionUID = -6082680802978974909L;
-
private static final String ON_DEFER_SET_SELECTED_NODE = "onDeferSetSelectedNode";
private static final CLogger logger;
@@ -186,6 +186,9 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
private boolean detailPaneMode;
private int tabNo;
+
+ /** DefaultFocusField */
+ private WEditor defaultFocusField = null;
public static final String ON_TOGGLE_EVENT = "onToggle";
@@ -545,6 +548,10 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
{
editor.addValueChangeListener(dataBinder);
}
+
+ // Default Focus
+ if (defaultFocusField == null && field.isDefaultFocus())
+ defaultFocusField = editor;
//stretch component to fill grid cell
editor.fillHorizontal();
@@ -977,11 +984,20 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
*/
public void focusToFirstEditor(boolean checkCurrent) {
WEditor toFocus = null;
- for (WEditor editor : editors) {
- if (editor.isVisible() && editor.isReadWrite() && editor.getComponent().getParent() != null
- && !(editor instanceof WImageEditor)) {
- toFocus = editor;
- break;
+
+ if (defaultFocusField != null
+ && defaultFocusField.isVisible() && defaultFocusField.isReadWrite() && defaultFocusField.getComponent().getParent() != null
+ && !(defaultFocusField instanceof WImageEditor)) {
+ toFocus = defaultFocusField;
+ }
+ else
+ {
+ for (WEditor editor : editors) {
+ if (editor.isVisible() && editor.isReadWrite() && editor.getComponent().getParent() != null
+ && !(editor instanceof WImageEditor)) {
+ toFocus = editor;
+ break;
+ }
}
}
if (toFocus != null) {