1. #1
    Sencha User
    Join Date
    Jul 2008
    Posts
    15
    Vote Rating
    0
    randymay is on a distinguished road

      0  

    Question Ext in a JSR-168 Compliant Portlet

    Ext in a JSR-168 Compliant Portlet


    I am trying to embed Ext components inside a JSR-168 compliant portlet. The issue I am having is when the portlet is initially added to the page, there is no page refresh, and therefore the Ext.onReady() function is not executed.

    Has anyone had any experience with getting around this issue?

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,000
    Vote Rating
    650
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Can't you just get rid of the onReady block then?

    Moving this to help.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Jul 2008
    Posts
    15
    Vote Rating
    0
    randymay is on a distinguished road

      0  

    Default


    When I try that, IE gives me an unspecific error: "Internet Explorer cannot open the Internet site... Operation aborted."

    Note that this works in Firefox.
    Last edited by randymay; 19 Sep 2008 at 2:13 AM. Reason: Additional information

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I'm not very into portals (I'm misusing WebSphere Portal soley for content management)...

    How are portlets rendered by the browser? As an IFRAME or as dynamically inserted HTML?

    Ext 2.2 does have some problems with IFRAMEs and onReady() in IE.

  5. #5
    Sencha User
    Join Date
    Jul 2008
    Posts
    15
    Vote Rating
    0
    randymay is on a distinguished road

      0  

    Default


    The Portal I am using (Liferay), adds Portlets as <div> tags. The challenge I am having is that when I add the Ext libraries using the <script> tags, IE (works in FF), throws an error ('null' is null or not an object). IE is not loading ext-base.js, and throws the error when the <script> tag ext-all.js file is executed.

    I realize that the proper place for this question is probably the Liferay forum, but they tell me to load the .js files in a Liferay specific manor (add them to a Liferay specific xml file). I am hoping that someone using Ext in a JSR-168 or JSR-286 portlet has resolved, or worked around this problem, and can give me a heads up.

    I REALLY want to use Ext, but if I cannot get this running in IE 6, then I will be forced to use another tool set.

  6. #6
    Sencha User michaelc's Avatar
    Join Date
    Dec 2007
    Location
    Bay Area - CA
    Posts
    507
    Vote Rating
    0
    michaelc is on a distinguished road

      0  

    Default


    I worked with websphere for a period of time.
    can you not add the main ExtJs Libraries into the Theme of the site ?

    the only JS code I would think you would add at portlet render time would be the portlet specific code. this would then load the bulk of the javascript only one time.

  7. #7
    Sencha User
    Join Date
    Jul 2008
    Posts
    15
    Vote Rating
    0
    randymay is on a distinguished road

      0  

    Default


    Is there a Portal agnostic way of adding to the theme? In an XML file that would be deployed in the .war? I am hoping to make a complete JSR-168 compliant .war file that can be deployed in any compliant Portal, and work without any additional installation steps.

  8. #8
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    @randymay -- If your WAR resource file (which the "Liferay specific xml file implies") loads the Ext framework after the initial page is rendered, the traditional Ext.EventManager code is going to stop you cold (as it document.writes a <script> tag during initialization to support Ext.onReady for IE) effectively wiping out your start page.

    This proposed replacement solves that problem with a more modern mechanism for detecting IE-DOM onReady for Ext 2.2.

    Good luck with it.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  9. #9
    Sencha User
    Join Date
    Jul 2008
    Posts
    15
    Vote Rating
    0
    randymay is on a distinguished road

      0  

    Default


    That works beautifully!

    Thank you!