Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4933

Palette does not handle disabled choices correctly

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.4.0
    • 6.5.0
    • wicket-extensions
    • None

    Description

      It is possible to add choices to a Palette with the disabled HTML attribute. This attribute is respected by all modern browsers and prevents the selection of disabled choices.

      However Palette also has a double-click handler, which will ignore the disabled attribute and add the choice to the selection.

      The Javascript palette.js can be modified to prevent disabled choices from being added to the selection:

      Wicket.Palette.moveHelper=function(source, dest) {
      var dirty=false;
      for (var i=0;i<source.options.length;i++) {
      if (source.options[i].selected && !source.options[i].disabled)

      { dest.appendChild(source.options[i]); i--; dirty=true; }

      }
      return dirty;
      };

      Maybe it makes sense to integrate this into Palette?

      Attachments

        Activity

          People

            svenmeier Sven Meier
            aka Andreas Kappler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: