ICEfaces
  1. ICEfaces
  2. ICE-8225

ace:fileEntry - upload listener is not called when commandButton returns an action

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1, EE-3.0.0.GA, 3.1.0.BETA1
    • Fix Version/s: 3.1.0.RC1, 3.1, EE-3.0.0.GA_P01
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P1

      Description

      If a commandButton returns navigation, the fileEntry listener will not run. In our testing, if the commandButton that submits the form containing a fileEntry returns a navigation case or navigation string, the fileEntry listener doesn't run at all. Since the listener also can't return a navigation case, the only way we have of routing the user to a different view after uploading a file is by doing a hard redirect inside of the listener. For optional files, we also have to dual-develop the navigation - once in a button that doesn't have the file and returns a navigation, the second time inside the listener.

      Please see attached fileUploadProblem2.xhtml for a demonstration. The first submit button is not wired to an action. The second is wired to an action that returns null. Both work. The third is wired to an action that returns navigation. It fails. You can see in console that the UploadBean's "Set a file" output is never produced.

        Activity

        Arran Mccullough created issue -
        Hide
        Arran Mccullough added a comment -

        Attached test case that shows issue. Run fileUploadProblem2.jsf to see issue.

        Show
        Arran Mccullough added a comment - Attached test case that shows issue. Run fileUploadProblem2.jsf to see issue.
        Arran Mccullough made changes -
        Field Original Value New Value
        Attachment Case11331Example.war [ 14535 ]
        Attachment Case11331Example.zip [ 14536 ]
        Arran Mccullough made changes -
        Salesforce Case [5007000000MHZeZ]
        Ken Fyten made changes -
        Assignee Priority P1
        Assignee Mark Collette [ mark.collette ]
        Hide
        Mark Collette added a comment -

        From FileEntryMeta:

        @Property(tlddoc="When true, the fileEntryListener will be invoked at " +
        "the end of the APPLY_REQUEST_VALUES phase. Otherwise, it will be " +
        "invoked just before rendering, so that the application will " +
        "receive the event, regardless of whether the form has passed " +
        "validation or not.",
        defaultValue="false")
        private boolean immediate;

        The default is for the fileEntryListener to be invoked at the beginning of RENDER_RESPONSE, which won't happen if the view has navigated away to another. So try setting immediate="true" on the fileEntryListener, when using navigation. If that phase is not convenient, then try setting immediate="true" as well as using ice:setEventPhase, but I'm not sure if you can use INVOKE_APPLICATION, since it will still navigate away and I'm not sure if the FileEntryEvent will be handled first.

        Show
        Mark Collette added a comment - From FileEntryMeta: @Property(tlddoc="When true, the fileEntryListener will be invoked at " + "the end of the APPLY_REQUEST_VALUES phase. Otherwise, it will be " + "invoked just before rendering, so that the application will " + "receive the event, regardless of whether the form has passed " + "validation or not.", defaultValue="false") private boolean immediate; The default is for the fileEntryListener to be invoked at the beginning of RENDER_RESPONSE, which won't happen if the view has navigated away to another. So try setting immediate="true" on the fileEntryListener, when using navigation. If that phase is not convenient, then try setting immediate="true" as well as using ice:setEventPhase, but I'm not sure if you can use INVOKE_APPLICATION, since it will still navigate away and I'm not sure if the FileEntryEvent will be handled first.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #29780 Tue Jul 03 08:17:21 MDT 2012 mark.collette ICE-8225 : ace:fileEntry - upload listener is not called when commandButton returns an action
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/fileentry/FileEntry.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/fileentry/FileEntryMeta.java
        Hide
        Mark Collette added a comment -

        Added the ability for the fileEntryListener to return an outcome that, if non-null, will be used for navigation. Tested with immediate set to true and false, and navigation works. Old bean methods that have a void return type are fine, they just don't trigger navigation. Updated the FileEntryMeta @Property docs to explain it all.

        icefaces3 trunk
        Subversion 29780

        Show
        Mark Collette added a comment - Added the ability for the fileEntryListener to return an outcome that, if non-null, will be used for navigation. Tested with immediate set to true and false, and navigation works. Old bean methods that have a void return type are fine, they just don't trigger navigation. Updated the FileEntryMeta @Property docs to explain it all. icefaces3 trunk Subversion 29780
        Ken Fyten made changes -
        Fix Version/s 3.1.0.RC1 [ 10337 ]
        Fix Version/s 3.1 [ 10312 ]
        Ken Fyten made changes -
        Fix Version/s EE-3.0.0.GA_P01 [ 10327 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #29798 Wed Jul 04 08:06:03 MDT 2012 mark.collette ICE-8225 : ace:fileEntry - upload listener is not called when commandButton returns an action
        Files Changed
        Commit graph MODIFY /icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/ace/component/src/org/icefaces/ace/component/fileentry/FileEntryMeta.java
        Commit graph MODIFY /icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/ace/component/src/org/icefaces/ace/component/fileentry/FileEntry.java
        Hide
        Mark Collette added a comment -

        Ported to the maintenance branch.

        icefaces3-maintenance branch
        Subversion 29798

        Show
        Mark Collette added a comment - Ported to the maintenance branch. icefaces3-maintenance branch Subversion 29798
        Mark Collette made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mark Collette added a comment -

        For testing:

        Have a bean fileEntryListener of return type void. Set immediate to true and false for uploads and make sure that still works, as before.

        Have a fileEntryListener of return type String and return null, "", and a valid navigation outcome. Test with immediate set to tr and false for each of those.

        Show
        Mark Collette added a comment - For testing: Have a bean fileEntryListener of return type void. Set immediate to true and false for uploads and make sure that still works, as before. Have a fileEntryListener of return type String and return null, "", and a valid navigation outcome. Test with immediate set to tr and false for each of those.
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: