ICEfaces-EE
  1. ICEfaces-EE
  2. IPCK-356

EE Composite Showcase example is not working when running with MyFaces

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.0.0.BETA
    • Fix Version/s: EE-3.0.0.GA
    • Component/s: Samples
    • Labels:
      None
    • Environment:
      ICEfaces EE MyFaces
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration

      Description

      Running the current version of the EE Composite Showcase with MyFaces is not working.

        Activity

        Hide
        Deryk Sinotte added a comment -

        I don't see the warning message (problem #5) any more so it looks like the latest changes might have solved that. However, clicking the top-level folder links still doesn't open/collapse the panels (problem #4). I can see the request sent and the updates coming back but they are pretty much empty - just the ViewState.

        To help clarify I'm attaching a screenshot (ee-composite-nav-links-comparison.png) of two Safari windows both running EE Composite Showcase. MyFaces version is on the left and Mojarra is on the right. When the link is clicked, it looks like 2 requests are sent sequentially and the second one actually submits the changed value for rendering out the collapsed panel. At least it does for Mojarra, and with MyFaces it doesn't send anything, which would explain the lack of a meaningful DOM diff update.

        Show
        Deryk Sinotte added a comment - I don't see the warning message (problem #5) any more so it looks like the latest changes might have solved that. However, clicking the top-level folder links still doesn't open/collapse the panels (problem #4). I can see the request sent and the updates coming back but they are pretty much empty - just the ViewState. To help clarify I'm attaching a screenshot (ee-composite-nav-links-comparison.png) of two Safari windows both running EE Composite Showcase. MyFaces version is on the left and Mojarra is on the right. When the link is clicked, it looks like 2 requests are sent sequentially and the second one actually submits the changed value for rendering out the collapsed panel. At least it does for Mojarra, and with MyFaces it doesn't send anything, which would explain the lack of a meaningful DOM diff update.
        Hide
        Deryk Sinotte added a comment -

        So here's an interesting behaviour. If you look at the rendered output for the headers of the collapsible panels you see the following (edited to only show the relevant stuff):

        <div class="icePnlClpsblColpsdHdr navPnlClpsblColpsdHdr" id="navfrm:navRpt:1:navPcollapsehdr" onclick="document.forms['navfrm']['navfrm:navRpt:1:navPcollapseExpanded'].value='false'; iceSubmit(document.forms['navfrm'],this,event);document.forms['navfrm']['navfrm:navRpt:1:navPcollapseExpanded'].value=''; return false;">

        <div ...>

        <a ...></a>

        <div ...>

        <a class="iceCmdLnk navNodeLink" href="javascript:;" id="navfrm:navRpt:1:navComplnk" onblur="setFocus('');" onclick="var form=formOf(this);form['navfrm:j_idcl'].value='navfrm:navRpt:1:navComplnk';form['nodeId'].value='dataTableCompositionComponentsNode';iceSubmit(form,this,event);ice.onAfterUpdate(function()

        {form['navfrm:j_idcl'].value='';form['nodeId'].value='';}

        );return false;" onfocus="setFocus(this.id);">Table Components</a>

        </div>

        </div>

        </div>

        So there's a top-level <div> that has an onclick handler that sets the value for the hidden field:

        document.forms['navfrm']['navfrm:navRpt:1:navPcollapseExpanded'].value='false';

        And then there's the anchor itself which does the normal form submission. Turns out that if you click on the <div> but not the anchor, the panel works properly. If you click on the anchor text, it doesn't work because the onclick from the <div> doesn't appear to get called and therefor the value for the hidden field is not set.

        Show
        Deryk Sinotte added a comment - So here's an interesting behaviour. If you look at the rendered output for the headers of the collapsible panels you see the following (edited to only show the relevant stuff): <div class="icePnlClpsblColpsdHdr navPnlClpsblColpsdHdr" id="navfrm:navRpt:1:navPcollapsehdr" onclick="document.forms ['navfrm'] ['navfrm:navRpt:1:navPcollapseExpanded'] .value='false'; iceSubmit(document.forms ['navfrm'] ,this,event);document.forms ['navfrm'] ['navfrm:navRpt:1:navPcollapseExpanded'] .value=''; return false;"> <div ...> <a ...></a> <div ...> <a class="iceCmdLnk navNodeLink" href="javascript:;" id="navfrm:navRpt:1:navComplnk" onblur="setFocus('');" onclick="var form=formOf(this);form ['navfrm:j_idcl'] .value='navfrm:navRpt:1:navComplnk';form ['nodeId'] .value='dataTableCompositionComponentsNode';iceSubmit(form,this,event);ice.onAfterUpdate(function() {form['navfrm:j_idcl'].value='';form['nodeId'].value='';} );return false;" onfocus="setFocus(this.id);">Table Components</a> </div> </div> </div> So there's a top-level <div> that has an onclick handler that sets the value for the hidden field: document.forms ['navfrm'] ['navfrm:navRpt:1:navPcollapseExpanded'] .value='false'; And then there's the anchor itself which does the normal form submission. Turns out that if you click on the <div> but not the anchor, the panel works properly. If you click on the anchor text, it doesn't work because the onclick from the <div> doesn't appear to get called and therefor the value for the hidden field is not set.
        Hide
        Philip Breau added a comment -

        Fixed issue with Dialog: 30603 2/27/12 5:27 PM 1 philip.breau IPCK-356 - Dialog throws non-serializable exception

        Show
        Philip Breau added a comment - Fixed issue with Dialog: 30603 2/27/12 5:27 PM 1 philip.breau IPCK-356 - Dialog throws non-serializable exception
        Hide
        Deryk Sinotte added a comment -

        So one way to "fix" the problem with the commandLinks is not to use them. Since clicking on the collapsiblePanel header facet is doing the job anyway, I just replaced the commandLinks with outputText and let the panel header do it's thing:

        Index: samples/ee-composite-showcase/src/main/webapp/WEB-INF/includes/content/navigation.xhtml
        ===================================================================
        — samples/ee-composite-showcase/src/main/webapp/WEB-INF/includes/content/navigation.xhtml (revision 30599)
        +++ samples/ee-composite-showcase/src/main/webapp/WEB-INF/includes/content/navigation.xhtml (revision )
        @@ -33,13 +33,12 @@

        <f:facet name="header">
        <ice:panelGroup id="navPgrp">

        • <ice:commandLink id="navComplnk"
        • actionListener="# {applicationController.navigationEvent}

          "

        • styleClass="navNodeLink"
        • value="# {msgs[nodeLevel1.label]}">
          + <h:outputText id="navComplnk"
          + value="#{msgs[nodeLevel1.label]}

          "
          + styleClass="navNodeLink">
          <f:param name="nodeId"
          value="#

          {nodeLevel1.id}

          "/>

        • </ice:commandLink>
          + </h:outputText>
          </ice:panelGroup>
          </f:facet>

        The styling is a bit off but you can reliably open and close the panels this way.

        Show
        Deryk Sinotte added a comment - So one way to "fix" the problem with the commandLinks is not to use them. Since clicking on the collapsiblePanel header facet is doing the job anyway, I just replaced the commandLinks with outputText and let the panel header do it's thing: Index: samples/ee-composite-showcase/src/main/webapp/WEB-INF/includes/content/navigation.xhtml =================================================================== — samples/ee-composite-showcase/src/main/webapp/WEB-INF/includes/content/navigation.xhtml (revision 30599) +++ samples/ee-composite-showcase/src/main/webapp/WEB-INF/includes/content/navigation.xhtml (revision ) @@ -33,13 +33,12 @@ <f:facet name="header"> <ice:panelGroup id="navPgrp"> <ice:commandLink id="navComplnk" actionListener="# {applicationController.navigationEvent} " styleClass="navNodeLink" value="# {msgs[nodeLevel1.label]}"> + <h:outputText id="navComplnk" + value="#{msgs[nodeLevel1.label]} " + styleClass="navNodeLink"> <f:param name="nodeId" value="# {nodeLevel1.id} "/> </ice:commandLink> + </h:outputText> </ice:panelGroup> </f:facet> The styling is a bit off but you can reliably open and close the panels this way.
        Hide
        Philip Breau added a comment -

        CommandLink nested in the PanelCollapsible has been removed. Showcase now works ok on MyFaces.

        Show
        Philip Breau added a comment - CommandLink nested in the PanelCollapsible has been removed. Showcase now works ok on MyFaces.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: