Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4416

pdfviewer doesn't encode updated src urls

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.0.0
    • Freshly, 9.0.0
    • Components
    • Security Level: Jimmy

      Steps to Reproduce

      load pdf from CWR

          <pdfviewer id="pdf2" src="~./test.pdf" height="300px"/>
          <button label="test2" onClick='pdf2.setSrc("~./test2.pdf");'/>
      

      load pdf from absolute path (when using a webapp context path)

          <pdfviewer id="pdf3" src="/resources/pdf/test.pdf" height="300px"/>
          <button label="test3" onClick='pdf3.setSrc("/resources/pdf/test2.pdf");'/>
      

      Current Result

      calling setSrc() with a CWR path or absolute path results in failing download URLs, due missing URL encoding

      Expected Result

      working URL encoding

      Debug Information

      _src is not encoded

      	public void setSrc(String src) {
      		if (!Objects.equals(_src, src)) {
      			_src = src;
      			_content = null;
      			_activePage = 0;
      			smartUpdate("src", _src);
      		}
      	}
      

      Workaround

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h