mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fixed changes asked on PR - fixed unstable form
This commit is contained in:
committed by
Mario Romano
parent
9c3fa30a0b
commit
c418c2e1d5
@@ -54,6 +54,7 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit, After
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
this.value = this.field.value;
|
||||
this.visibilityService.refreshEntityVisibility(this.field);
|
||||
if (this.field.params) {
|
||||
let originalField = this.field.params['field'];
|
||||
if (originalField && originalField.type) {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
[attr.id]="field.id"
|
||||
[(ngModel)]="field.value"
|
||||
(ngModelChange)="checkVisibility(field)">
|
||||
<option *ngFor="let opt of field.options" [value]="getOptionValue(opt)" [id]="opt.id">{{opt.name}}</option>
|
||||
<option *ngFor="let opt of field.options" [value]="getOptionValue(opt, field.value)" [id]="opt.id">{{opt.name}}</option>
|
||||
</select>
|
||||
<span *ngIf="field.validationSummary" class="mdl-textfield__error">{{field.validationSummary}}</span>
|
||||
</div>
|
||||
|
@@ -82,9 +82,9 @@ export class DropdownWidget extends WidgetComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
getOptionValue(option: FormFieldOption): string {
|
||||
getOptionValue(option: FormFieldOption, fieldValue: string): string {
|
||||
let optionValue: string = '';
|
||||
if (option.id === 'empty' || option.name !== this.field.value) {
|
||||
if (option.id === 'empty' || option.name !== fieldValue) {
|
||||
optionValue = option.id;
|
||||
} else {
|
||||
optionValue = option.name;
|
||||
|
Reference in New Issue
Block a user