Nativescript RadDataForm MultilineText not working on Android

不想你离开。 提交于 2019-12-10 11:53:13

问题


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:


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.



来源:https://stackoverflow.com/questions/52786055/nativescript-raddataform-multilinetext-not-working-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!