ICEfaces
  1. ICEfaces
  2. ICE-7940

Navigation on page that had an ace:fileEntry component does a full page submit

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Workaround Exists:
      Yes
    • Workaround Description:
      Use different forms for the fileEntry component and/or the links that do navigation.

      Description

      If a page includes an ace:fileEntry component and a h:commanLink is clicked that does a forward navigation, the entire page is submitted as opposed to a partial-response.

      Doing the same navigation on a page that does not include the fileEntry component results in a partial-response.
      1. Case11090Example.zip
        17 kB
        Arran Mccullough
      2. Case11090ExampleWAR.zip
        9.49 MB
        Arran Mccullough

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case that shows issue:

        1. Open source2.xhtml and click the link. In the network traffic (for example with firebug) you'll see the partial-response in the response body. Which is the desired behavior.
        2. Open source1.xhtml and click the link. In the network traffic you'll see that the whole page is being sent.

        Show
        Arran Mccullough added a comment - Attached test case that shows issue: 1. Open source2.xhtml and click the link. In the network traffic (for example with firebug) you'll see the partial-response in the response body. Which is the desired behavior. 2. Open source1.xhtml and click the link. In the network traffic you'll see that the whole page is being sent.
        Hide
        Mark Collette added a comment -

        When using fileEntry in a form we tell people to use an h:commandButton to upload the file, since it's the only thing that will do the standard form submit that we intercept and will upload the file. Usually most other things do direct ajax calls, or are intercepted by our ICEfaces mechanisms, and so will do incremental page updates. But h:commandLink instead calls it's own javascript function that programmatically calls form.submit, which doeasn't cause the onsubmit function to get called, so it doesn't do the proper file upload handling to switch the form to being multi-part etc.

        <a href="mojarra.jsfcljs(document.getElementById('myform'),

        {'myform:mycmdlnk':'myform:mycmdlnk'}

        ,'');return false"/>

        In the test case, with the non-fileEntry page, ICEfaces' ice.captureSubmit replaces the form.submit() function with ours. The h:commandLink calls form.submit(), so everything goes through ICEfaces properly.

        With the fileEntry page, ACE's captureFileOnsubmit() replaces the form.onsubmit handler with ours. The h:commandLink calls form.submit(), which is then the default one, since ACE only overrides form.onsubmit, and when that happens the core does not override form.submit, so it's just the stock one that does a full page submit.

        Show
        Mark Collette added a comment - When using fileEntry in a form we tell people to use an h:commandButton to upload the file, since it's the only thing that will do the standard form submit that we intercept and will upload the file. Usually most other things do direct ajax calls, or are intercepted by our ICEfaces mechanisms, and so will do incremental page updates. But h:commandLink instead calls it's own javascript function that programmatically calls form.submit, which doeasn't cause the onsubmit function to get called, so it doesn't do the proper file upload handling to switch the form to being multi-part etc. <a href="mojarra.jsfcljs(document.getElementById('myform'), {'myform:mycmdlnk':'myform:mycmdlnk'} ,'');return false"/> In the test case, with the non-fileEntry page, ICEfaces' ice.captureSubmit replaces the form.submit() function with ours. The h:commandLink calls form.submit(), so everything goes through ICEfaces properly. With the fileEntry page, ACE's captureFileOnsubmit() replaces the form.onsubmit handler with ours. The h:commandLink calls form.submit(), which is then the default one, since ACE only overrides form.onsubmit, and when that happens the core does not override form.submit, so it's just the stock one that does a full page submit.
        Hide
        Mark Collette added a comment -

        Things to investigate:

        • What exactly happens with Mojarra
        • Could ACE fileEntry override form.submit, as core does, and call the original submit method, and still upload file(s)?
        • Could the ACE capture just set everything up right away instead of hooking on the onsubmit, similarly to how the accessibility mode works, but not interfere with the other ajax submits from other components in the form?
        Show
        Mark Collette added a comment - Things to investigate: What exactly happens with Mojarra Could ACE fileEntry override form.submit, as core does, and call the original submit method, and still upload file(s)? Could the ACE capture just set everything up right away instead of hooking on the onsubmit, similarly to how the accessibility mode works, but not interfere with the other ajax submits from other components in the form?
        Hide
        Ted Goddard added a comment -

        If the browser being used for the application supports HTML 5, it would be possible to implement upload via FormData.

        Another option would be to place the fileEntry portion of the page within an iframe.

        Show
        Ted Goddard added a comment - If the browser being used for the application supports HTML 5, it would be possible to implement upload via FormData. Another option would be to place the fileEntry portion of the page within an iframe.

          People

          • Assignee:
            Unassigned
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: