Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Navigating to other pages

    What is the proper SmartClient method to navigate to a different page, or even open a non-SmartClient page in a new window? Do I need to use SmartClient's window object somehow? I tried using a menu's click event and window.open, which successfully opened a new window, but the original browser window threw JavaScript errors in the process:

    Code:
    [Exception... "'Permission denied to get property XULElement.accessKey' when calling method: [nsIDOMXULLabelElement::accessKey]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: http://testMachine:8080/xxx/Menu.js :: navigateToDash :: line 53" data: no]
    [Break on this error] var newWindow = window.open("/dash", "win_dash");
    Code:
    isc.Menu.create({
        ID:"Menu2",
        title:textResources.Menu2,
        data: [
            {title:textResources.Menu2_1},
            {title:textResources.Menu2_2},
            {title:textResources.Menu2_3, click: "navigateToDash()"},
            {title:textResources.Menu2_4},
            {title:textResources.Menu2_5},
        ]
    });
    
    function navigateToDash() {
        var newWindow = window.open("/dash", "win_dash");
        if (newWindow) {
            if (newWindow.focus) {
                newWindow.focus();
            }
        }
    }

    #2
    Hi Mark,

    The best approach here varies by scenario.

    If you want to show a new "page" that is part of your SmartClient application, you generally do this by hiding one SmartClient component and showing another, without doing an actual page transition.

    If you are trying to integrate with or embed a non-SmartClient application into SmartClient, you can:

    1) create a SmartClient front-end for it, integrating with the application at the data/services layer

    2) pop-up a second Window as you are trying to do

    3) try to manage the application as an embedded IFrame, by using the HTMLPane component with contentsType:"page", perhaps contained within a SmartClient Window component. This last approach yields quick results, but has lots of gotchas, including links in the embedded application that target "_top", thus blowing away the containing SmartClient application.

    Comment


      #3
      About that error - that's a widely reported, harmless and bogus error issued by Firefox. Theoretically, it will be corrected by the time Firefox 3 goes final. It probably does not have to do with your attempt to open a Window.

      Comment


        #4
        Culprit found!

        The culprit, I found, was the google toolbar extension in firefox. Other folks report problems with other firefox extensions too. If you disable the google toolbar extension in firefox, the Javascript errors on "window.open()" go away.

        BTW, IE works fine with the google toolbar enabled.

        Comment


          #5
          I have tried out Your third approach - embed arbitrary website within a SmartClient Window component - like this:
          Code:
           
          	  isc.Window.create({
                          width:"50%", 
          		height:"50%",
          		ID: "browserWindow",
          		title: "Browser Window",
          		autoCenter: true,
          		src: "http://www.kaitischler.name"
          		});
          This works like a "Browser Window in the Browser" for the given URL; and for www.smartclient.com, too :-) But for all other URLs I have tried so far, the original webpage gets blown away immediately on first click :-(

          So the question is: Is the "Browser Window in the Browser" concept realizable at all ? I have also tried out BittyBrowser which gets blown away, too ...

          Comment


            #6
            Hi SchlauKunde,

            You are experiencing possible issue #3 - links in embedded content may blow away the surrounding page.

            Generally speaking, the browser-in-a-browser concept can only be reliably achieved if you control the content or site that you are trying to embed.

            Comment

            Working...
            X