ordinal & id in all classes

This commit is contained in:
annampak 2017-11-30 10:14:54 +02:00
parent 7116e0159f
commit e5d31cb080
5 changed files with 53 additions and 8 deletions

View File

@ -2,10 +2,18 @@
<div [formGroup]="form">
<div class="form-row">
<div class="form-group col-md-12">
<div class="form-group col-md-6">
<div class="form-group col-md-4">
<label>Multiplicity</label>
<input type="nymber" class="form-control" formControlName="multiplicity">
</div>
<div class="form-group col-md-4">
<label>Ordinal</label>
<input type="nymber" class="form-control" formControlName="ordinal">
</div>
<div class="form-group col-md-4">
<label>Id</label>
<input type="nymber" class="form-control" formControlName="id">
</div>
</div>
</div>

View File

@ -2,15 +2,19 @@
<!-- style="border-style: solid;"-->
<div [formGroup]="form">
<div class="form-row">
<div class="form-group col-md-4">
<div class="form-group col-md-5">
<label>Title</label>
<input type="text" class="form-control" formControlName="title">
</div>
<div class="form-group col-md-4">
<div class="form-group col-md-2">
<label>Id</label>
<input type="text" class="form-control" formControlName="id">
</div>
<div class="form-group col-md-4">
<div class="form-group col-md-2">
<label>Ordinal</label>
<input type="text" class="form-control" formControlName="ordinal">
</div>
<div class="form-group col-md-3">
<label class="radio control-label">DefaultVisibility</label>
<label class="radio-inline">
<input type="radio" id="defaultVisibility" value="true" formControlName="defaultVisibility"> true

View File

@ -6,17 +6,23 @@ import {Field} from './Field'
export class CompositeField extends BaseModel implements Serializable<CompositeField> {
public fields:Array<Field> = new Array<Field>();
public multiplicity:number;
public id:string;
public ordinal:number;
fromJSONObject(item:any):CompositeField{
this.fields = new JsonSerializer<Field>().fromJSONArray(item.fields,Field);
this.multiplicity = item.multiplicity;
this.id = item.id;
this.ordinal = item.ordinal;
return this;
}
buildForm():FormGroup{
let formGroup = this.formBuilder.group({
multiplicity:[this.multiplicity]
multiplicity:[this.multiplicity],
id:[this.id],
ordinal:[this.ordinal]
});
let fieldsFormArray = new Array<FormGroup>();

View File

@ -0,0 +1,23 @@
import { BaseModel } from './BaseModel';
import { FormGroup } from '@angular/forms';
import { FormGenerator } from './interfaces/FormGenerator';
import { Serializable } from './interfaces/Serializable';
export class Multiplicity extends BaseModel implements Serializable<Multiplicity>,FormGenerator<FormGroup>{
public min:number;
public max:string;
fromJSONObject(item:any):Multiplicity{
this.min = item.min;
this.max = item.max;
return this;
}
buildForm():FormGroup{
let formGroup = this.formBuilder.group({
min: [this.min],
max: [this.max]
});
return formGroup;
}
}

View File

@ -2,15 +2,19 @@
<!--style="border-style: solid;"-->
<div [formGroup]="form">
<div class="form-row">
<div class="form-group col-md-4">
<div class="form-group col-md-5">
<label>Title</label>
<input type="text" class="form-control" formControlName="title">
</div>
<div class="form-group col-md-4">
<div class="form-group col-md-2">
<label>Id</label>
<input type="text" class="form-control" formControlName="id">
</div>
<div class="form-group col-md-4">
<div class="form-group col-md-2">
<label>Ordinal</label>
<input type="text" class="form-control" formControlName="ordinal">
</div>
<div class="form-group col-md-3">
<label class="radio control-label">defaultVisibility</label>
<label class="radio-inline">
<input type="radio" name="defaultVisibility" id="inlineRadio1" value="true" formControlName="defaultVisibility"> true