ICEmobile
  1. ICEmobile
  2. MOBI-668

ContentStack generates JS error if used without ContentStackMenu or ContentNavBar on the page

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2 Final
    • Fix Version/s: 1.3.1
    • Component/s: Faces
    • Labels:
      None
    • Environment:
      n/a

      Description

      The contentStack renders out the following javascript:

      <script type="text/javascript">mobi.layoutMenu.initClient('j_idt6:contentStack',{stackId: 'j_idt6:contentStack',selectedId: 'page1', single: false,hash: 106426242,selClientId: 'j_idt6:page1',home: 'null',client: false});</script>

      The layoutMenu functions are only available when the Content Stack Menu or Content Nav Bar is rendered on the page, so when it's not on the page, this call results in the following error:

      Uncaught TypeError: Cannot call method 'initClient' of undefined index.jsf:13
      (anonymous function)

        Issue Links

          Activity

          Philip Breau created issue -
          Philip Breau made changes -
          Field Original Value New Value
          Summary ContentStack generates JS error if used without ContentStackMenu on the page ContentStack generates JS error if used without ContentStackMenu or ContentNavBar on the page
          Philip Breau made changes -
          Description The contentStack renders out the following javascript:

          <script type="text/javascript">mobi.layoutMenu.initClient('j_idt6:contentStack',{stackId: 'j_idt6:contentStack',selectedId: 'page1', single: false,hash: 106426242,selClientId: 'j_idt6:page1',home: 'null',client: false});</script>

          The layoutMenu functions are only available when the Content Stack Menu is rendered on the page, so when it's not on the page, this call results in the following error:

          Uncaught TypeError: Cannot call method 'initClient' of undefined index.jsf:13
          (anonymous function)
          The contentStack renders out the following javascript:

          <script type="text/javascript">mobi.layoutMenu.initClient('j_idt6:contentStack',{stackId: 'j_idt6:contentStack',selectedId: 'page1', single: false,hash: 106426242,selClientId: 'j_idt6:page1',home: 'null',client: false});</script>

          The layoutMenu functions are only available when the Content Stack Menu or Content Nav Bar is rendered on the page, so when it's not on the page, this call results in the following error:

          Uncaught TypeError: Cannot call method 'initClient' of undefined index.jsf:13
          (anonymous function)
          Steve Maryka made changes -
          Assignee Steve Maryka [ steve.maryka ] Judy Guglielmin [ judy.guglielmin ]
          Hide
          Judy Guglielmin added a comment -

          in 1.3.0, the javascript is loaded if the contentStackMenu or contentNavBar is present, since the contentMenuItem is required to be a child of either and requires the resource (but it only needs to be loaded a single time, so a check is done and not loaded if a flag in the context shows it already has been)

          In 1.4 Beta, the javascript will be loaded with the contentStack component, so having a single component responsible for the presence of the resource, should be easier to trace any problems.

          Show
          Judy Guglielmin added a comment - in 1.3.0, the javascript is loaded if the contentStackMenu or contentNavBar is present, since the contentMenuItem is required to be a child of either and requires the resource (but it only needs to be loaded a single time, so a check is done and not loaded if a flag in the context shows it already has been) In 1.4 Beta, the javascript will be loaded with the contentStack component, so having a single component responsible for the presence of the resource, should be easier to trace any problems.
          Hide
          Judy Guglielmin added a comment -

          this jira will be redundant upon completion of MOBI-672

          Show
          Judy Guglielmin added a comment - this jira will be redundant upon completion of MOBI-672
          Judy Guglielmin made changes -
          Link This issue depends on MOBI-672 [ MOBI-672 ]
          Philip Breau made changes -
          Assignee Judy Guglielmin [ judy.guglielmin ] Philip Breau [ philip.breau ]
          Philip Breau made changes -
          Assignee Philip Breau [ philip.breau ] Judy Guglielmin [ judy.guglielmin ]
          Philip Breau made changes -
          Assignee Judy Guglielmin [ judy.guglielmin ] Philip Breau [ philip.breau ]
          Hide
          Philip Breau added a comment -

          The ContentNavBarRenderer doesn't include the script, so it's a not sufficient to include the contentNavBar.

          Show
          Philip Breau added a comment - The ContentNavBarRenderer doesn't include the script, so it's a not sufficient to include the contentNavBar.
          Hide
          Philip Breau added a comment -

          Revision: 38305
          Author: philip.breau
          Date: September-29-13 7:39:12 PM
          Message:
          MOBI-668 - ContentStack generates JS error if used without ContentStackMenu or ContentNavBar on the page

          • move js into main component.js file so it's always available

            Deleted : /icemobile/trunk/icemobile/jsf/components/component/resources/org.icefaces.component.layoutmenu
            Modified : /icemobile/trunk/icemobile/jsf/components/component/resources/org.icefaces.component.util/component.js
            Modified : /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstack/ContentStackRenderer.java
            Modified : /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstackmenu/ContentStackMenuRenderer.java

          Show
          Philip Breau added a comment - Revision: 38305 Author: philip.breau Date: September-29-13 7:39:12 PM Message: MOBI-668 - ContentStack generates JS error if used without ContentStackMenu or ContentNavBar on the page move js into main component.js file so it's always available Deleted : /icemobile/trunk/icemobile/jsf/components/component/resources/org.icefaces.component.layoutmenu Modified : /icemobile/trunk/icemobile/jsf/components/component/resources/org.icefaces.component.util/component.js Modified : /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstack/ContentStackRenderer.java Modified : /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstackmenu/ContentStackMenuRenderer.java
          Philip Breau made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.4 Beta [ 10874 ]
          Resolution Fixed [ 1 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #38305 Sun Sep 29 16:39:12 MDT 2013 philip.breau MOBI-668 - ContentStack generates JS error if used without ContentStackMenu or ContentNavBar on the page
          - move js into main component.js file so it's always available
          Files Changed
          Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstack/ContentStackRenderer.java
          Commit graph DEL /icemobile/trunk/icemobile/jsf/components/component/resources/org.icefaces.component.layoutmenu
          Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstackmenu/ContentStackMenuRenderer.java
          Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/resources/org.icefaces.component.util/component.js
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #38306 Sun Sep 29 16:49:26 MDT 2013 philip.breau MOBI-668 - ContentStack generates JS error if used without ContentStackMenu or ContentNavBar on the page
          - move js into main component.js file so it's always available
          Files Changed
          Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstack/ContentStackRenderer.java
          Philip Breau made changes -
          Fix Version/s 1.3.1 [ 11376 ]
          Fix Version/s 1.4 Beta [ 10874 ]

            People

            • Assignee:
              Philip Breau
              Reporter:
              Philip Breau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: