1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    65
    Answers
    7
    Vote Rating
    2
    sl5337 is on a distinguished road

      0  

    Default Answered: Sencha Touch 2 and Safari on Windows

    Answered: Sencha Touch 2 and Safari on Windows


    First I would like to congratulate the Ext team on the release of ExtJS 4 and the MVC architecture. I have worked with the various 3.x releases for years and only recently embraced ExtJS 4 but I feel like it is hands-down the most elegant framework for building rich Web clients. As a Java Web application programmer the MVC framework feels very natural to me. Given that, I decided to start working with the preview releases of Sencha Touch 2 rather than continue with 1.1 since version 2 follows the same MVC architecture as ExtJS 4. I have run into a strange problem. I am using Safari on Windows with the user agent set to Safari iOS 4.3.3 - iPad. When I run the "Getting Started" example app, the screen remains blank and in a second or two I get the message:

    Error:[ERROR][Ext.viewport.Ios#undefined] Timeout waiting for window.innerHeight to change

    For kicks, I decided to grab the top of the browser with my mouse and resize the browser immediately after clicking the link to launch the app and sure enough, the app displayed correctly. I realize that I am still working with a preview release so I'm not getting all upset about this but I was wondering if there is anything I can do at this point to get around this quirk and move forward. I have read some posts mentioning Ext.setup but I don't know what that is and it seems very different from the ExtJS 4 MVC method of launching an application.

    Thanks in advance for any help you can provide.

  2. I was finally able to get my iPad to run the Web app by using the IP address of my desktop and found that it works as expected. So the answer to this one is that there is a problem running an MVC-style app using the Safari user agent emulations for iOS but it runs fine on the real device. I can live with that.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    751
    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


    Ext.setup is similar (not a copy but similar) to Ext.onReady in the Ext JS world but since you are using MVC it doesn't matter.

    For quickness can I get your code so I can take a look at what's going on? All the layouts are managed by CSS so we don't control the layouts. We control the structure of the DOM that will then control the layouts.
    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.

  4. #3
    Sencha User
    Join Date
    Dec 2007
    Posts
    65
    Answers
    7
    Vote Rating
    2
    sl5337 is on a distinguished road

      0  

    Default


    I would be glad to send you my code if you think it would help, but actually I can reproduce it by running the Kitchen Sink app in the examples folder of the pr3 release. This app uses the MVC approach to launching the application which is the direction I would like to go. I'm using Apache 2.2 as my server and running the app in Safari 5.1.2 on Windows 7. As long as I leave Safari on the default user agent it runs fine (and actually I may continue to develop this way for now, just resize the browser to match an iPad). But if I change the user agent to any of the Safari iOS 4.3.3 settings the screen goes blank. Interestingly enough, I just tried running the Kitchen Sink app in that same manner directly from your web site and it runs fine. Likewise when I point my iPad directly to the app on your web site it runs fine. So I really can't explain why the screen goes blank when I run it on my local server with Safari emualing the iPad. As I mentioned I'm just running it straight out of the examples folder. But its not just the Kitchen Sink app. It's any app that uses the Ext.application({...}) method of starting the app. I had no problems at all when I was working with the Sencha Touch 1.1 framework.

    I will continue to troubleshoot this on my end because obviously the app runs fine if I point my browser or iPad to your web site so it must be something local to my environment. However, I would be interested to know your results if you could try running it locally from the examples folder using Safari with the iPad user agent setting turned on.

  5. #4
    Sencha User
    Join Date
    Dec 2007
    Posts
    65
    Answers
    7
    Vote Rating
    2
    sl5337 is on a distinguished road

      0  

    Default


    I have isolated the problem to the following function in Ext.viewport.Ios. I have highlighted the relevant code in red:

    Code:
     maximize: function() {
            if (this.isFullscreen()) {
                return this.callParent();
            }
    
            var stretchHeights = this.stretchHeights,
                orientation = this.orientation,
                currentHeight = this.getWindowHeight(),
                height = stretchHeights[orientation];
    
            if (window.scrollY > 0) {
                this.scrollToTop();
    
                if (!height) {
                    stretchHeights[orientation] = height = this.getWindowHeight();
                }
    
                this.setHeight(height);
                this.fireMaximizeEvent();
            }
            else {
                if (!height) {
                    height = this.getScreenHeight();
                }
    
                this.setHeight(height);
    
                this.waitUntil(function() {
                    this.scrollToTop();
                    return currentHeight !== this.getWindowHeight();
                }, function() {
                    if (!stretchHeights[orientation]) {
                        height = stretchHeights[orientation] = this.getWindowHeight();
                        this.setHeight(height);
                    }
    
                    this.fireMaximizeEvent();
                }, function() {
                    Ext.Logger.error("Timeout waiting for window.innerHeight to change", this);
                });
            }
        },
    When I put a breakpoint on the line "return currentHeight !== this.getWindowHeight()" I find that in my case currentHeight always equals this.getWindowHeight() so the waitUntil loop keeps firing until it times out.

    This is all the code I have in the application so far:
    Code:
    Ext.application({
        name: 'Sencha',    
        launch: function() {
            Ext.create("Ext.TabPanel", {
                fullscreen: true,
                items: [
                    {
                        title: 'Home',
                        iconCls: 'home',
                        html: 'Welcome'
                    }
                ]
            });
        }
    });
    If anyone can think of something else for me to try please let me know. Thanks.

  6. #5
    Sencha User
    Join Date
    Dec 2007
    Posts
    65
    Answers
    7
    Vote Rating
    2
    sl5337 is on a distinguished road

      0  

    Default


    I was finally able to get my iPad to run the Web app by using the IP address of my desktop and found that it works as expected. So the answer to this one is that there is a problem running an MVC-style app using the Safari user agent emulations for iOS but it runs fine on the real device. I can live with that.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar