Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5098

javascript error in hidden form

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      HtmlMenuRenderer generates like bellow form tags. It generates double target="_BLANK" , then cause javascript error.

      <li><form method="post" action="/ar/control/invoice.pdf" target="_BLANK" name="InvoiceSubTabBar_pdf_LF_8"><input name="invoiceId" value="8010" type="hidden"/></form><a target="_BLANK" href="javascript:document.InvoiceSubTabBar_pdf_LF_8.submit()">PDF</a></li>

      document.InvoiceSubTabBar_pdf_LF_8 is undefined @ javascript:document.InvoiceSubTabBar_pdf_LF_8.submit()

      Index: framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
      ===================================================================
      — framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java (revision 1419381)
      +++ framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java (working copy)
      @@ -455,10 +455,12 @@
      writer.append(name);
      writer.append("\"");
      }

      • if (UtilValidate.isNotEmpty(targetWindow)) {
      • writer.append(" target=\"");
      • writer.append(targetWindow);
      • writer.append("\"");
        + if (!"hidden-form".equals(linkType))
        Unknown macro: {+ if (UtilValidate.isNotEmpty(targetWindow)) { + writer.append(" target=\""); + writer.append(targetWindow); + writer.append("\""); + } }

      writer.append(" href=\"");

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jleroux Jacques Le Roux
            nfukue Naofumi Fukue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment