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

Specify Messagebox width

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 6.0.0
    • None
    • None
    • None

      It would be great to be able to specify the width or rather maximum width of a Messagebox directly in a show method call.
      The current implementation always maxes out at 330px width which in some cases simply look s very awkward.

      I've written my own messagebox ZUL template and Java classes for this purpose (in fact I initially did this to allow setting the button labels, which is now obsolete as it's a new feature in ZK 6.0.0).

      Would it be possible to include a width parameter in the argument map that is passed to messagebox.zul?

      outer.style.width = jq.px0(Math.min(Math.max(width, 330), jq.innerWidth() - 20));
      would subsequently be
      outer.style.width = jq.px0(Math.min(Math.max(width, ${arg.width}), jq.innerWidth() - 20));

      The Java component introduces another parameter that might simply be specified in an additional Messagebox.show() method:

      params.put("width", (width!=null) && (width>Messagebox.DEFAULT_MAX_WIDTH) ? width : Messagebox.DEFAULT_MAX_WIDTH);

      DEFAULT_MAX_WIDTH remains 330(px) but it might also be handy to have a static setter allowing to specify the width globally.

            Unassigned Unassigned
            andiklein andiklein
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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