ICEmobile
  1. ICEmobile
  2. MOBI-320

NPE thrown when calling UIComponent.findComponent() with empty string id

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0 Final
    • Fix Version/s: 1.3.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      ICEfaces 3.1

      Description

      There may be scenarios where a user wants to enclose all content (specifically contentStack/ContentPane) within 1 form tag. Currently the contentStackMenu will only work if a form tag directly surrounds it like so:

      <h:form>
      <h:panelGroup>
      <mobi:contentStackMenu>
      <mobi:contentMenuItem label="Menu" />
      <mobi:contentMenuItem label="Pane 1" value="panel1" />
      .............
      </mobi:contentStackMenu>
      </h:panelGroup>
      </h:form>

      If you were to move the closing form tag to the bottom of the page (below the contentPanes), the following NPE is thrown:

      java.lang.NullPointerException
      at org.icefaces.mobi.component.contentmenuitem.ContentMenuItemRenderer.renderItemAsList(ContentMenuItemRenderer.java:153)
      at org.icefaces.mobi.component.contentmenuitem.ContentMenuItemRenderer.encodeEnd(ContentMenuItemRenderer.java:66)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
      at org.icefaces.mobi.renderkit.BaseLayoutRenderer.renderChild(BaseLayoutRenderer.java:50)
      at org.icefaces.mobi.renderkit.BaseLayoutRenderer.renderChildren(BaseLayoutRenderer.java:35)
      at org.icefaces.mobi.component.contentstackmenu.ContentStackMenuRenderer.encodeEnd(ContentStackMenuRenderer.java:97)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)

      Test case demonstrating issue attached. Ready for deployment on Tomcat 7.

        Issue Links

          Activity

          Tyler Johnson created issue -
          Tyler Johnson made changes -
          Field Original Value New Value
          Attachment Mobi-320.war [ 14870 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #30842 Thu Sep 13 17:33:04 MDT 2012 judy.guglielmin MOBI-320 and test case. contentStack and contentStackMenu either must be siblings in same form OR must know the actual jsf selection id of the contentStack and use it in the menu's contentStackId attribute. (for example "mynamingContainer:myStack")
          Files Changed
          Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentmenuitem/ContentMenuItemRenderer.java
          Commit graph ADD /icemobile/trunk/icemobile/jsf/components/tests/mobitest/src/main/webapp/layout/MOBI320.xhtml
          Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/tests/mobitest/src/main/webapp/layoutComponents.html
          Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstackmenu/ContentStackMenuMeta.java
          Commit graph MODIFY /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentstackmenu/ContentStackMenu.java
          Migration made changes -
          Fix Version/s 1.2 Beta [ 10344 ]
          Philip Breau made changes -
          Fix Version/s 1.2 Beta [ 10344 ]
          Ted Goddard made changes -
          Assignee Steve Maryka [ steve.maryka ] Judy Guglielmin [ judy.guglielmin ]
          Ted Goddard made changes -
          Fix Version/s 1.3 Beta [ 10373 ]
          Judy Guglielmin made changes -
          Fix Version/s 1.4 Beta [ 10874 ]
          Fix Version/s 1.3 Beta [ 10373 ]
          Hide
          Judy Guglielmin added a comment -

          work done on MOBI-672 will resolve this.

          Show
          Judy Guglielmin added a comment - work done on MOBI-672 will resolve this.
          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 -
          Summary NPE thrown if <h:form> not directly surrounding contentStackMenu NPE thrown when calling UIComponent.findComponent() with empty string id
          Hide
          Philip Breau added a comment -

          Revision: 38315
          Author: philip.breau
          Date: September-30-13 2:16:07 PM
          Message:
          MOBI-836 NPE thrown when calling UIComponent.findComponent() with empty string id

          • guard against all calls to UIComponent.findComponent() with a check for a null or empty string

            Modified : /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/button/CommandButtonRenderer.java
            Modified : /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentmenuitem/ContentMenuItemRenderer.java
            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/submitnotification/SubmitNotificationRenderer.java

          Show
          Philip Breau added a comment - Revision: 38315 Author: philip.breau Date: September-30-13 2:16:07 PM Message: MOBI-836 NPE thrown when calling UIComponent.findComponent() with empty string id guard against all calls to UIComponent.findComponent() with a check for a null or empty string Modified : /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/button/CommandButtonRenderer.java Modified : /icemobile/trunk/icemobile/jsf/components/component/src/org/icefaces/mobi/component/contentmenuitem/ContentMenuItemRenderer.java 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/submitnotification/SubmitNotificationRenderer.java
          Philip Breau made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Philip Breau made changes -
          Fix Version/s 1.3.1 [ 11376 ]
          Fix Version/s 1.4 Beta [ 10874 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: