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

Setting image attribute of caption to empty string or null cause it to display a missing image

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.2
    • 8.5.1.2
    • None
    • Security Level: Jimmy
    • None
    • ZK with Iceblue theme (breeze theme doesn't remove the image either, but the default width / height in breeze are not set so the missing image default to 0px / 0px instead of 20/20px in IceBlue

    • ZK 8.5.2 S1, ZK 8.5.2 S2

      Steps to Reproduce

      Run fiddle
      http://zkfiddle.org/sample/1gqbgec/3-zk-iceblue-caption-image-bug
      Click on the "hide image" button to set the caption image value to "" (or null - same behavior)

      Current Result

      the caption image is displaying a broken image source (<img src="(unknown)" in Dom tree)

      Expected Result

      The image node should not be displayed if the source is set to "" or null

      Debug Info

      Root Cause

      Workaround

      <script><![CDATA[
      	zk.afterLoad('zul', function() {
      		var xLabelImageWidget = {};
      		zk.override(zul.LabelImageWidget.prototype, xLabelImageWidget ,{
      			setImage : function(v) {
      				if((v == null || v == "")&&this.$n()){
      					jq(this.$n("img")).hide()
      				}else{
      					jq(this.$n("img")).show()
      				}
      				var result = xLabelImageWidget.setImage.apply(this, arguments);
      				return result;
      			}
      		});//zk.override
      	});//zk.afterLoad
      	]]></script>
      

            klyvechen klyvechen
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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