RadListView Error

Thread is closed for posting
7 posts, 1 answers
  1. Stan
    Stan avatar
    40 posts
    Member since:
    May 2017

    Posted 13 May 2017 Link to this post

    I'm new to NativeScript and I'm trying out RadListView but I'm getting an "Error: A Frame must be used to navigate to a page". 
    I copied & pasted the code from https://www.nativescript.org/blog/a-deep-dive-into-telerik-ui-for-nativescripts-listview and only took out the CSS references.

    main-page.xml
    <Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:lv="nativescript-telerik-ui/listview" loaded="pageLoaded">

        <lv:RadListView id="listview"> 
            <lv:RadListView.listViewLayout>
                <lv:ListViewLinearLayout scrollDirection="Vertical"/>
            </lv:RadListView.listViewLayout>
            <lv:RadListView.itemTemplate>
                <StackLayout>
                    <Label text="{{ itemName }}" />
                    <Label text="{{ itemDesc }}" textWrap="true" />
                </StackLayout>
            </lv:RadListView.itemTemplate>
        </lv:RadListView>

    </Page>

    main-page.js
    var listview = require("nativescript-telerik-ui/listview");
    var view = require("ui/core/view");

    exports.pageLoaded = function(args) {
        var items = [];
        items.push(
            {
                itemName: "Arcade Fire",
                itemDesc: "Funeral"
            },
            {
                itemName: "Bon Iver",
                itemDesc: "For Emma, Forever Ago"
            },
            {
                itemName: "Daft Punk",
                itemDesc: "Random Access Memories"
            },
            {
                itemName: "Elbow",
                itemDesc: "Build a Rocket Boys!"
            }
        )
        var page = args.object;
        var listview = view.getViewById(page, "listview");
        listview.items = items;
    }

    Any ideas on what I'm missing?
  2. Answer
    Nikolay Tsonev
    Admin
    Nikolay Tsonev avatar
    340 posts

    Posted 15 May 2017 Link to this post

    Hello,
    First of all, thank you for your interest in UI for NativeScript.

    I reviewed the below-attached code and tested on my side, however, was unable to reproduce this error.
    For your convenience, I am attaching the sample project, which I used for testing.
    Regarding that, could you provide some more info about your environment(NativeScript CLI, tns-core-modules, node versions)?   It would also help if you could also send us sample project, where the problem could be reproduced.
    Regards,
    nikolay.tsonev
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  3. Stan
    Stan avatar
    40 posts
    Member since:
    May 2017

    Posted 15 May 2017 in reply to Nikolay Tsonev Link to this post

    Thank you so much for the zip file with the working code!

    With the files you sent I was able to trace what was wrong. Somehow my project app.js file had the old format giving me the error, it works find now with your file. Thanks again!

    OLD:

    var application = require("application");
    application.mainModule = "main-page";
    application.cssFile = "app.css";
    application.start();

    NEW:

    require("./bundle-config");
    var application = require("application");

    application.start({ moduleName: "main-page" });

  4. Stan
    Stan avatar
    40 posts
    Member since:
    May 2017

    Posted 15 May 2017 in reply to Nikolay Tsonev Link to this post

    Can RadListView use multiple templates like the regular ListView? thanks again
  5. Nikolay Tsonev
    Admin
    Nikolay Tsonev avatar
    340 posts

    Posted 16 May 2017 Link to this post

    Hi,
    At this time in the RadListView could be used only one template, however, we have already logged this as a feature request in our nativescript-ui-feedback repository.

    For further info about the feature, you could keep track on this issue here.

    Let me know if I could assist you further

    Regards,
    nikolay.tsonev
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  6. Stan
    Stan avatar
    40 posts
    Member since:
    May 2017

    Posted 16 May 2017 in reply to Nikolay Tsonev Link to this post

    Thank you for that info Nikolay, I will track the new feature.

    In the meantime, can the core-ListView scroll horizontal or is that only available in RadListView?

  7. Nikolay Tsonev
    Admin
    Nikolay Tsonev avatar
    340 posts

    Posted 17 May 2017 Link to this post

    Hello Stan,

    Thank you for writing us back 
    Unfortunately, horizontal scroll functionality is supported only from the RadListView component.
    However, the multiple templates feature is already planned for the upcoming release of UI for NativeScript as it is mentioned in the issue and will be available soon. 

    Let me know if I could assist you further

    Regards,
    nikolay.tsonev
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top