1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    themaji is on a distinguished road

      0  

    Default Unanswered: Trouble with 'Hello-World' example, please advise.

    Unanswered: Trouble with 'Hello-World' example, please advise.


    Hi All,
    During the process of getting started in SENCHA in the course of following the 'Hello-World' example/tutorial, I was unsuccessful in getting this to happen:
    "The <body> element, which we had left plain and empty, has gained interesting id and class attributes. We don't need to worry about what these mean, but they are evidence that the Sencha Touch library has been invoked, and it has prepared the document for us to start placing a user interface into it."

    This did not happen, after following the directions carefully.

    I am guessing that I have the Sencha library installed incorrectly?
    I have it located in a subdirectory called 'hello-world' within the 'site' directory on my local machine which is a G5 powermac running OSX 10.5.8. When I navigate to the directory within chrome to view it, I get the blank white screen, but when i look at the source code of the page i do not see the addition of the 'The <body> element, which we had left plain and empty, has gained interesting id and class attributes'. I went ahead and added the script code to the index file and the page shows the blank screen and the source view shows the code as before. I attempted another test by installing the 'hello-world' directory up to a server located at http://www.gotoits.com/hello-world to see if it was a problem with the apache server running on my local machine and still the same results. I have the Sencha 1 SDK loaded n the 'lib' directory as instructed. I attempted all of this with the sencha 2.0 package, but it does not seem to be accessible from a web browser using the 2.0 download, I would be most interested in installing 2.0 successfully. If anyone has any feedback I would be very grateful.
    Anybody have any suggestions for me?

    Thanks.

    Stephen

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The id and class won't be added to the <body> element until you do Ext.setup or Ext.application...

    Code:
    Ext.application({
        name : 'Test',
    
        launch : function() {
            console.log('I have launched!');
        }
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    themaji is on a distinguished road

      0  

    Default


    Hi Mitchell!
    thanks for taking some time with this..
    I am not quite sure about where to put this snippet you have supplied though.
    are you saying this is something that goes into the index.html file in the hello-world folder?

    this is what I have in the file currently.

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Hello World</title>

    <script src="lib/touch/sencha-touch-all.js" type="text/javascript"></script>
    <link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">

    Ext.application({
    launch: function () {
    Ext.create('Ext.Panel', {
    fullscreen: true,
    html: 'Hello World!'
    });
    }
    });

    </script>

    </head>
    <body></body>
    </html>


    I just followed the directions in the exercise, but it seems you are suggesting there is set-up that needs to be run on the sencha 1.01 kit?

    Please advise, and thanks again.

    Stephen


    Quote Originally Posted by mitchellsimoens View Post
    The id and class won't be added to the <body> element until you do Ext.setup or Ext.application...

    Code:
    Ext.application({
        name : 'Test',
    
        launch : function() {
            console.log('I have launched!');
        }
    });

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    themaji is on a distinguished road

      0  

    Default


    Continuing I see that the index.html file has a bit of code in place that is likely what you are referring to.
    The bit in this html file is

    Ext.application({
    launch: function () {
    Ext.create('Ext.Panel', {
    fullscreen: true,
    html: 'Hello World!'
    });

    So I am still somewhat lost... heh.

    Thanks for the time,

    Stephen

  5. #5
    Sencha User
    Join Date
    Jan 2011
    Posts
    134
    Vote Rating
    5
    Answers
    6
    JRS is on a distinguished road

      0  

    Default Follow this getting started guide - very helpful

    Follow this getting started guide - very helpful


    Hi

    This video is very helpful in getting started.

    Good luck
    JRS
    http://docs.sencha.com/touch/2-0/#!/...etting_started

  6. #6
    Sencha User
    Join Date
    Jul 2010
    Location
    Belo Horizonte, Brazil
    Posts
    14
    Vote Rating
    0
    Answers
    2
    brunowerneck is on a distinguished road

      0  

    Default


    By creating the panel you only say to the ST2 to create a component but the ST2 does not know where to render it.

    As you're using the MVC approach, the ST2 viewport is automatically created so that you can add items dynamically.

    Try changing your code to:

    Code:
    Ext.application({
    name: 'Demo',
        launch: function () {
            var myPanel = Ext.create('Ext.Panel', {
                fullscreen: true,
                html: 'Hello World!'
            });
        Ext.Viewport.add(myPanel);
        }
    });
    

  7. #7
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by themaji View Post
    I just followed the directions in the exercise, but it seems you are suggesting there is set-up that needs to be run on the sencha 1.01 kit?
    No, that is valid ST2 code
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  8. #8
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    themaji is on a distinguished road

      0  

    Default Onward... Revising my approach.

    Onward... Revising my approach.


    I have realized that since I am so new to this platform that it is probably best that I start anew from 2.0 and abandon my efforts to get the hello world example in the 1.0 development. I thought to do this before, but ran into this problem when I moved the unzipped sencha 2 files into my localserver.
    I pointed safari to the address and see the files as a directory, ftp style, the script does not start up.
    i made a screen shot for you attached below, I know, I'm a newb.
    Attached Images

  9. #9
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    That's because there is no index.html or anything there for the web browser to server as a web page.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.