ICEfaces
  1. ICEfaces
  2. ICE-2275

Remove need for inputFile glue code

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1, 1.7DR#2
    • Fix Version/s: 1.7.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All, Seam
    • Affects:
      Sample App./Tutorial

      Description

      Right now, if you want to use an ice:inputFile with an ice:outputProgress component, you have to use a lot of glue code in the bean, to hold the percent progress, and more importantly, to kickoff a render to show that progress.

      Particularly the challenge is that, with Seam, while the pre-upload render in the main servlet has access to the PersistentFacesState for its rendering, the during-upload render in the UploadServer does not have access to it, which means that when the UploadServer calls the InputFile component, which calls the bean's progressListener, there's non-trivial code in the bean's progressListener that has to hold the PersistentFacesState from the pre-upload render, to use for the during-upload render.

      We can remove all of that glue logic, if the InputFile does two things:

      1. Grab the PersistentFacesState when it renders itself. Technically the InputFileRenderer handles this, but it actually delegates back to InputFile for rendering the IFRAME. Then, when setProgress(int) is called on the InputFile, is can invoke the progressListener, and simply initiate the render itself.

      2. Add an attribute to the InputFile (called outputProgress?) that would have the outputProgress' id, so it can look it up, and simply call something like OutputProgress.setValue(this.getProgress()).

      Now, the usage of #2 would be what sets off #1, since we don't want both the InputFile and any legacy bean progressListener code firing off a render. The contract of the outputProgress attribute would be that the application is asynchronous, and that the ice:outputProgress component is not trying to use a ValueBinding for its value attribute, and that any progressListener is not going to be using the renderManager.

      One difference is that renderManager.requestRender seems to be doing a bit more than just PersistentFacesState.execute() then render(). So that should be looked into.

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16773 Fri May 30 16:37:57 MDT 2008 mark.collette ICE-2275 : Remove need for inputFile and glue code
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/inputfile/InputFile.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/samples/component-showcase/common-web/WEB-INF/faces-config-example-beans.xml
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/inputFile/InputFileController.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-inputFile-props.xml
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/component/FileUploadComponent.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/webapp/http/core/UploadServer.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/webapp/xmlhttp/PersistentFacesState.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/samples/component-showcase/common-web/WEB-INF/includes/examples/custom/inputFile.jspx
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/inputFile/InputFileData.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16770 Fri May 30 16:36:35 MDT 2008 mark.collette ICE-2275 : Remove need for inputFile and glue code
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/xmlhttp/PersistentFacesState.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/inputfile/InputFile.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/component/FileUploadComponent.java
        Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/inputFile/InputFileData.java
        Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-web/WEB-INF/includes/examples/custom/inputFile.jspx
        Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/inputFile/InputFileController.java
        Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-web/WEB-INF/faces-config-example-beans.xml
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/UploadServer.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-inputFile-props.xml

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Collette
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: