Should I give up trying to use Enyo ?

edited May 2013 in Newbie Questions

After two days of trying to do without any success pretty simple things that I have been able to do very easily in two hours using JQM, I am about to give up ENYO.

Last chance is this forum. I just want to display a simple list:
    name: "App",
    fit: true,
    components: [
            kind: "ProductList"
    create: function () {

    name: "ProductList",
    fit: true,
    components: [
            name: "list",
            kind: "List",
            count: 200,
            onSetupItem: "setupItem",
            components: [
                {classes: "ListItemContainer", components: [
                            name: "productName",
                            content: "test content"
                            name: "productDescription"
    create: function() {
    setupItem: function (inSender, inEvent) {
        this.$.productName.setContent("test" + Math.random());
        this.$.productDescription.setContent("Description " + Math.random());
        return true;
setupItem is NEVER called. Why ?
Same thing if I put it in the App Kind...

Thanks... But... Well...


  • Seems to be working perfectly here:

    I just copied your source and re-formatted it to read it better.
  • Thank you for your reply, SugarDave

    Using cordova .7.0, Windows 8 and Visual Studio 2012. create() is called but setupItem, never. Does not run in the browser either (IE, Chrome). Removing cordova does not help.
  • edited May 2013
    I'm a newbie too so perhaps I'm wrong but I had to set the list's size to make it works...
    something like
  • @opolette, as @sugardave commented, your code is perfectly right. Maybe you're not rendering the app?

    <script>new App().renderInto(document.body);</script>
  • @FlexOnMobile: Flex is great. Too bad Adobe has not understood that...
    Concerning your point: where would you put the setcount?
    @rafa_bernad : yes I did. As said, create() gets called.

    Thanks both for your replies
  • edited May 2013
    Well, as soon as you initialize the object, create() is called, but that doesn't mean you've rendered it:

    var myApp = new App();

    Doesn't make any changes to the DOM, but creates an object, so create() gets called.

    Again, your code is right, and it should work as expected.
  • Here is the code of my index.html
    <!DOCTYPE html>
    		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    		<title>Enyo Bootplate App</title>
    		<link rel="shortcut icon" href="assets/favicon.ico"/>
    		<!-- -->
    		<meta http-equiv="Content-Type" content="text/html; charset=utf8"/>
    		<meta name="apple-mobile-web-app-capable" content="yes"/>
    		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    		<!-- css -->
    		<link href="build/enyo.css" rel="stylesheet"/>
    		<link href="build/app.css" rel="stylesheet"/>
    		<!-- js -->
            <script src="js/cordova-2.7.0.js"></script>
    		<script src="build/enyo.js"></script>
    		<script src="build/app.js"></script>
    	<body class="enyo-unselectable">
    			if (!window.App) {
    				alert('No application build found, redirecting to debug.html.');
    				location = 'debug.html';
    			new App().renderInto(document.body);
  • Are you getting any errors in the console? Have you tried seeing if you can get the default bootplate app to render?
  • Are you using Enyo 2.2 or nightly? I know that earlier versions of Enyo didn't work as Win8 apps because of use of unsafe calls that the Win8 HTML runtime doesn't support.
  • @chrisvanhooser
    Good point! Yes we have something here: no constructor found for kind "List"
    I tried to include the package.js (thinking the layout lib might not be included) but I get this wonderful "0x800c001c - JavaScript runtime error:" error (Windows 8 / IE10 security) line 158 of enyo.js (R 2.2).
    So I replaced the block of the script function by
    script: function(e, t, n) {
        enyo.execUnsafeLocalFunction(function () {
            if (!enyo.runtimeLoading) document.write('<script src="' + e + '"' + (t ? ' onload="' + t + '"' : "") + (n ? ' onerror="' + n + '"' : "") + "></scri" + "pt>"); else {
                var r = document.createElement("script");
                r.src = e, r.onload = t, r.onerror = n, document.getElementsByTagName("head")[0].appendChild(r);
    and it works...

    Has it been forgotten by the ENYO team?
  • You have to use a minified/deployed version of Enyo to make a Win8 app. The script loader WILL NOT work in the app.
Sign In or Register to comment.