MyFaces Core
  1. MyFaces Core
  2. MYFACES-2388

Link to download FILE on a Dialog fails of FF

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.6
    • Fix Version/s: 1.2.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP, Firefox 3.5.3

      Description

      On placing a link on a Dialog to download a file, gives javascript error "Form undefined".
      Find Sample generated Js below:

      oamSubmitForm('downloadDialog-f','downloadDialog-f:downloadBulkData',null,[['Uri','ExportedData.zip']]);

      On analyzing further, in methods, oamSubmitForm() and oamSetHiddenInput() it can't find the form.
      I modified "Get form logic" from:

      var form = document.forms[formName];

      to

      var form = document.getElementById(formName);

      and it now works. We are currently using this workaround. But a neat solution in the jar would be more preferable.

        Activity

        Hide
        Leonardo Uribe added a comment -

        It seems to be something related to put the link on the Dialog, because the base case works without problem.

        Anyway, it seem reasonable replace this:

        var form = document.forms[formName];

        with this:

        var form = document.forms[formName];
        if (typeof form == 'undefined')

        { form = document.getElementById(formName); }

        So, if the form is not available under document.forms, there is a chance to lookup it using document.getElementById.

        Show
        Leonardo Uribe added a comment - It seems to be something related to put the link on the Dialog, because the base case works without problem. Anyway, it seem reasonable replace this: var form = document.forms [formName] ; with this: var form = document.forms [formName] ; if (typeof form == 'undefined') { form = document.getElementById(formName); } So, if the form is not available under document.forms, there is a chance to lookup it using document.getElementById.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Paskal Sanil
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

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

                Development