This is a migrated thread and some comments may be shown as answers.

RadListView Error

6 Answers 31 Views
ListView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stan
Top achievements
Rank 1
Stan asked on 13 May 2017, 11:08 PM
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?

6 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Tsonev
Telerik team
answered on 15 May 2017, 06:08 AM
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, -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.
0
Stan
Top achievements
Rank 1
answered on 15 May 2017, 08:56 PM

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" });

0
Stan
Top achievements
Rank 1
answered on 15 May 2017, 09:09 PM
Can RadListView use multiple templates like the regular ListView? thanks again
0
Nikolay Tsonev
Telerik team
answered on 16 May 2017, 05:20 AM
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 --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.
0
Stan
Top achievements
Rank 1
answered on 16 May 2017, 11:43 PM

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?

0
Nikolay Tsonev
Telerik team
answered on 17 May 2017, 05:24 AM
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.
Tags
ListView
Asked by
Stan
Top achievements
Rank 1
Answers by
Nikolay Tsonev
Telerik team
Stan
Top achievements
Rank 1
Share this question
or