ICEfaces
  1. ICEfaces
  2. ICE-2629

inputFile is reseting com.icesoft.faces.component.inputfile.InputFile properties

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#3
    • Fix Version/s: 1.7RC1, 1.7
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      normal JSF deployment
    • Workaround Exists:
      Yes
    • Workaround Description:
      Manualy copy InputFile properties into a new object.

      Description

      I was just reviewing the component showcase inputFile example and finally took the time to look into an issue that has been bugging me fore some time.

      When using inputFile component a user binds an method to it to which is called when the file is successfully uploaded. The user then can get the InputFile object that was uploaded.

      public void uploadFile(ActionEvent event) {
              InputFile inputFile = (InputFile) event.getSource();
      .....
      }

      The problem I have is that InputFile is reset right after the my uploadFile method is called leaving me with a useless object. The only work around is to copy the needed properties in to a new object or say good bye.

      Here's what I think would be acceptable solutions:
       - have Input file implement a deep clone method
      - better yet have the component create a new instance of InputFile so that I can decide on how they should be reset/disposed.

        Activity

        Patrick Corless created issue -
        Hide
        Patrick Corless added a comment -

        Can you get Adnan to take a look.

        Show
        Patrick Corless added a comment - Can you get Adnan to take a look.
        Patrick Corless made changes -
        Field Original Value New Value
        Assignee Ken Fyten [ ken.fyten ]
        Ken Fyten made changes -
        Assignee Ken Fyten [ ken.fyten ] Mark Collette [ mark.collette ]
        Hide
        Mark Collette added a comment -

        I totally agree, whenever we clear out that object, we should just be making a new one. Then we could change the component-showcase example code to reflect how you won't have to pull out each of the data bits separately anymore.

        Show
        Mark Collette added a comment - I totally agree, whenever we clear out that object, we should just be making a new one. Then we could change the component-showcase example code to reflect how you won't have to pull out each of the data bits separately anymore.
        Ken Fyten made changes -
        Fix Version/s 1.7 [ 10080 ]
        Assignee Priority P2
        Ken Fyten made changes -
        Fix Version/s 1.7Beta1 [ 10121 ]
        Fix Version/s 1.7 [ 10080 ]
        Ken Fyten made changes -
        Fix Version/s 1.7 [ 10080 ]
        Fix Version/s 1.7Beta1 [ 10121 ]
        Hide
        Mark Collette added a comment -

        Wait, do you mean the FileInfo object gotten from InputFile, or the actual InputFile component itself?

        Show
        Mark Collette added a comment - Wait, do you mean the FileInfo object gotten from InputFile, or the actual InputFile component itself?
        Ken Fyten made changes -
        Assignee Priority P2 P3
        Ken Fyten made changes -
        Assignee Priority P3 P1
        Ken Fyten made changes -
        Comment [ Ignore the last comment, it was for ICE-2630. ]
        Ken Fyten made changes -
        Security Private [ 10001 ]
        Hide
        Patrick Corless added a comment -

        I mean the inputFile and of course the child FileInfo objct. Stop by and I'll show you the problem if you still don't get it.

        Show
        Patrick Corless added a comment - I mean the inputFile and of course the child FileInfo objct. Stop by and I'll show you the problem if you still don't get it.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #15932 Wed Mar 05 11:57:09 MST 2008 mark.collette ICE-2629 : inputFile is reseting com.icesoft.faces.component.inputfile.InputFile properties
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/inputfile/InputFile.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/inputfile/FileInfo.java
        Hide
        Mark Collette added a comment -

        Made FileInfo Cloneable, and InputFile's FileInfo getter method use cloning, so that beans can just keep the FileInfo they get, without having to pick it apart.

        Subversion 15932
        icefaces\component\src\com\icesoft\faces\component\inputfile\FileInfo.java
        icefaces\component\src\com\icesoft\faces\component\inputfile\InputFile.java

        Show
        Mark Collette added a comment - Made FileInfo Cloneable, and InputFile's FileInfo getter method use cloning, so that beans can just keep the FileInfo they get, without having to pick it apart. Subversion 15932 icefaces\component\src\com\icesoft\faces\component\inputfile\FileInfo.java icefaces\component\src\com\icesoft\faces\component\inputfile\InputFile.java
        Mark Collette made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.7RC1 [ 10123 ]
        Fix Version/s 1.7 [ 10080 ]
        Ken Fyten made changes -
        Fix Version/s 1.7 [ 10080 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1
        Assignee Mark Collette [ mark.collette ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: