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

Difficult to switch between height/width and hflex/vflex in HtmlBasedComponent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Normal
    • None
    • 8.0.1
    • General
    • Security Level: Jimmy
    • None
    • ZK 8.0.2 S1

    Description

      Due to the new interlocking logic in HtmlBasedComponent I have to do too much to switch between specific height/width or v/hflex for a component.

      For example, if I have set a component to be flexible i.e. previously called

      component.setHflex("1")

      then due to the new logic, to set it to a specific width with no hFlex I must do this:

      component.setHflex("min");
      component.setWidth(null);
      component.setHflex(null);
      component.setWidth(width);
      

      This could be simplified by checking for null/empty in the get/set flex, width and height methods:

      public void setHeight(String height)
      {
        if (height != null && !height.isEmpty() && getVflex() != null && !getVflex().equals("min")) {
          throw new UiException("Not allowed to set vflex and height at the same time except vflex=\"min\"");
        }
      }
      
      public void setWidth(String width)
      {
        if (width != null && !width.isEmpty() && getHflex() != null && !getHflex().equals("min")) {
          throw new UiException("Not allowed to set hflex and width at the same time except hflex=\"min\"");
        }
      }
      
      public void setVflex(String flex)
      {
        if (flex != null && !flex.isEmpty() && getHeight() != null && !"min".equals(flex)) {
          throw new UiException("Not allowed to set vflex and height at the same time except vflex=\"min\"");
        }
      }
      
      public void setHflex(String flex)
      {
        if (flex != null && !flex.isEmpty() && getWidth() != null && !"min".equals(flex)) {
          throw new UiException("Not allowed to set hflex and width at the same time except hflex=\"min\"");
        }
      }
      

      Attachments

        Issue Links

          Activity

            People

              wenninghsu wenninghsu
              nedski nedski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h