Nativescript RadDataForm MultilineText not working

2019-06-14 17:11发布

I am using RadDataForm in my Nativescript Angular project and when I try to use "MultilineText" it doesn't work on Android, it just appears as a normal "Text" box. I am not able to enter multiple lines. Works fine on iOS.

add-store.model.ts

export class AddStore {
    public name: string;
    public description: string;

    constructor(name: string, description: string,) {
        this.name = name;
        this.description = description;
    }
}

add-store-metadata-validation.json

{
    "isReadOnly": false,
    "commitMode": "immediate",
    "validationMode": "immediate",
    "propertyAnnotations":
    [
        {
            "name": "name",
            "displayName": "Store Name",
            "index": 1,
            "editor": "Text"

        },
        {
            "name": "description",
            "displayName": "Description",
            "index": 2,
            "editor": "MultilineText"

        }

    ]
}

add-store.component.ts

import { Component, AfterViewInit } from "@angular/core";
import { RouterExtensions } from "nativescript-angular/router";
import { UtilitiesService } from "~/services/utils.service";
import { AddStore } from "./add-store.model";

@Component({
    selector: "add-store",
    moduleId: module.id,
    templateUrl: "./add-store.component.html"
})

export class AddStoreComponent implements AfterViewInit {

    store: AddStore;
    metadata;

    constructor(private router:RouterExtensions) {
        this.store = new AddStore("test name" , "test\nsdfgfsdf");
        this.metadata = require("./add-store-metadata-validation.json");
    }

    ngAfterViewInit(): void { 

    }

    goBack() {
        this.router.back();
    }
}

add-store.component.html

<ActionBar class="action-bar" title="Store Setup">
    <NavigationButton android.systemIcon="ic_menu_back" (tap)="goBack()"></NavigationButton>
</ActionBar>
<GridLayout rows="*">
        <StackLayout row="0" class="page page-content" height="100%">
            <RadDataForm [source]="store" [metadata]="metadata"></RadDataForm>
        </StackLayout>  
</GridLayout>

1条回答
一夜七次
2楼-- · 2019-06-14 17:45

It looks like a issue with plugin, you may report same in the feedback repo.

As a workaround you may use TKPropertyEditor directive and define the editor type.

查看更多
登录 后发表回答