Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.3.5
    • Fix Version/s: 4.3.8
    • Component/s: component-input
    • Labels:
    • Environment:

      JBoss Portal 6.1.1

      Description

      When a rich:fileUpload si submitted (i.e. files are uploaded) action of the form is not preserved well.
      In fileupload.js __submit method there is the following code:

      var encodedURLInputs = this.form.children("input[name='javax.faces.encodedURL']");
      var originalAction = encodedURLInputs.length > 0 ? encodedURLInputs.val() : this.form.attr("action");
      

      the var "originalAction" is then used to revert to the original action url of the form. However, encodedURLInputs and form action prop does not contain the same url. Because encodedURLInputs has bigger priority URL from that input is restored into the form and not the original form action. This breaks the form as the next submission fails.

      In portal the solution is

      var originalFormAction =this.form.attr("action");
      

      and then restore "originalFormAction" instead of "originalAction", but I am not sure if this doesn't break anything in other environments.

      Is this a bug in richfaces or is the content of input[name='javax.faces.encodedURL'] set badly?
      To reproduce you can use the reproducer attached.

      Example URLs:
      form action

      /portal/classic/home/uploadform?portal:componentId=834fa198-ff3d-4a5c-a1c7-33c85e8a410d&interactionstate=JBPNS_rO0ABXcsABBfanNmQnJpZGdlVmlld0lkAAAAAQALL2hvbWUueGh0bWwAB19fRU9GX18*&portal:type=action
      

      input[name='javax.faces.encodedURL']

      /portal/classic/home/uploadform?portal:windowState=normal&portal:componentId=834fa198-ff3d-4a5c-a1c7-33c85e8a410d&portal:cacheLevel=PAGE&resourcestate=JBPNS_rO0ABXdAABBfanNmQnJpZGdlVmlld0lkAAAAAQALL2hvbWUueGh0bWwACF9wYnJBamF4AAAAAQAEdHJ1ZQAHX19FT0ZfXw**&portal:type=resource&portal:portletMode=view
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kenfinni Ken Finnigan
                  Reporter:
                  jtrantin Jonáš Trantina
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 1 hour
                    1h
                    Remaining:
                    Remaining Estimate - 1 hour
                    1h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified