new template

This commit is contained in:
Wolfgang Koch
2021-05-12 14:36:37 +02:00
parent 483a5f2696
commit e14a4e8c40
3 changed files with 30 additions and 9 deletions

View File

@@ -45,7 +45,7 @@ annotate OrdersService.Orders with @(
],
FieldGroup#Details: {
Data: [
{Value: currency.code, Label:'Currency'}
{Value: currency_code, Label:'Currency'}
]
},
FieldGroup#Created: {

View File

@@ -12,9 +12,9 @@ namespace Z_bookshop.extension;
// extend existing entity
extend orders.Orders with {
Z_newField : String default 'Default Value';
Z_NewAssociation : Association to one Z_NewEntity;
Z_NewEntity : Association to one Z_NewEntity;
Z_NewCodeList : Association to one Z_NewCodeList;
Z_NewComposition : Composition of many Z_NewCompEntity on Z_NewComposition.parent = $self;
Z_NewCompEntity : Composition of many Z_NewCompEntity on Z_NewCompEntity.parent = $self;
}
// new entity - as association target

View File

@@ -135,7 +135,7 @@ annotate OrdersService.Orders with @(
LineItem: [
{Value: OrderNo, Label:'OrderNo'},
{Value: Z_newField, Label:'New Field'}, // extension field
{Value: Z_NewAssociation_ID, Label:'New Association'}, // extension field
{Value: Z_NewEntity_ID, Label:'New Entity'}, // extension field
{Value: Z_NewCodeList_code, Label:'New Code'}, // extension field
{Value: createdAt, Label:'Date'}
],
@@ -159,13 +159,13 @@ annotate OrdersService.Orders with @(
Facets: [
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
{$Type: 'UI.ReferenceFacet', Label: '{i18n>OrderItems}', Target: 'Items/@UI.LineItem'},
{$Type: 'UI.ReferenceFacet', Label: 'New Composition', Target: 'Z_NewComposition/@UI.LineItem'} // new composition
{$Type: 'UI.ReferenceFacet', Label: 'New Composition', Target: 'Z_NewCompEntity/@UI.LineItem'} // new composition
],
FieldGroup#Details: {
Data: [
{Value: currency_code, Label:'Currency'}, // correction
{Value: Z_newField, Label:'New Field'}, // extension field
{Value: Z_NewAssociation_ID, Label:'New Association'}, // extension field
{Value: currency_code, Label:'Currency'},
{Value: Z_newField, Label:'New Field'}, // extension field
{Value: Z_NewEntity_ID, Label:'New Entity'}, // extension field
{Value: Z_NewCodeList_code, Label:'New Code'}, // extension field
]
},
@@ -184,4 +184,25 @@ annotate OrdersService.Orders with @(
},
) ;
// new field in existing service -- exchange ID with text
annotate OrdersService.Orders with {
Z_NewEntity @(
Common: {
//show description, not id for New Entity in the context of Orders
Text: Z_NewEntity.description , TextArrangement: #TextOnly,
ValueList: {
Label: 'New Entity',
CollectionPath: 'Z_NewEntity',
Parameters: [
{ $Type: 'Common.ValueListParameterInOut',
LocalDataProperty: Z_NewEntity_ID,
ValueListProperty: 'ID'
},
{ $Type: 'Common.ValueListParameterDisplayOnly',
ValueListProperty: 'description'
}
]
}
}
);
}