天天看点

Openbravo开发-开发篇 加字段到屏幕的tab中

下面解释三种类型

Text field(输入框)

Combo-box field(下拉框,指定固定值)

Reference field(下拉框,从库表中取)

一、Text field

1)加field到数据库中(见以前章节)

ALTER TABLE m_warehouse

ADD COLUMN em_ht_contact_info varchar(255);

2)加column 到屏幕中

Go to [b]Application Dictionary > Windows, Tabs and Fields[/b] in the application, and search for the Warehouse window (it's name is: Warehouse and Storage Bins).

Double click the Warehouse window record.

Then click on the Tab in the top.

Double click the warehouse tab record.

Now you are on the Tab view, in the bottom of this view there is a button 'Create Fields'. Click this button.

修改显示次序,GRID中的次序

使用Synchronize Terminology生成element,在Application Dictionary > Setup > Element中修改LABEL内容

3)导出数据库

ant export.database

4)发布

ant smartbuild

二、Combo-box field

1)在 AD_Reference 里加 需要的下拉内容

在validation type 中选择 list validation.

在list validation tab中填写内容

剩下步骤与text field一样,在加column 到table时选择

Set a description and help text.

Set reference to list.

Set the Reference Search Key to the reference record created earlier, CB_Location_Type(这个就是上面在AD_Reference中的名字).

三、Reference field

参考上面章节

不一样的地方有两个

1)加字段时要增加约束

ALTER TABLE m_warehouse

ADD COLUMN EM_HT_Shipping_Company varchar(32);

ALTER TABLE m_warehouse

ADD COLUMN EM_HT_Business_Partner varchar(32);

ALTER TABLE m_warehouse

ADD CONSTRAINT em_ht_shipping_company FOREIGN KEY (em_ht_shipping_company)

REFERENCES m_shipper (m_shipper_id) MATCH SIMPLE

ON UPDATE NO ACTION ON DELETE NO ACTION; ALTER TABLE m_warehouse

ADD CONSTRAINT em_ht_business_partner FOREIGN KEY (em_ht_business_partner)

REFERENCES c_bpartner (c_bpartner_id) MATCH SIMPLE

ON UPDATE NO ACTION ON DELETE NO ACTION;

2)加AD_Reference里选择table validation

在table tab中选择表名等