Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-499

Allow for images to illustrate options in ButtonSet Controls (Radio buttons, Checkbox buttons)

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • 2.1 Final
    • 2.1 Final
    • templating
    • None
    • all

      Following patches allow images to be added to dialogs with options, e.g. a radio button list.

      • Each button (radio, checkbox) can have its own image.
      • the image is configured through the property 'iconSrc' in the dialog definition for a particular option.
      • a custom css class can be configured through the property 'iconSrc' in the dialog definition

      — originals/magnolia-2.1-SNAPSHOT/src/main/info/magnolia/cms/gui/control/Button.java 2005-07-13 17:15:01.000000000 +0200
      +++ patched//magnolia-2.1-SNAPSHOT/src/main/info/magnolia/cms/gui/control/Button.java 2005-07-24 14:39:42.000000000 +0200
      @@ -181,8 +181,8 @@
      }
      html.append("\" " + this.getHtmlCssClass() + ">"); //$NON-NLS-1$ //$NON-NLS-2$

      • html.append(this.getIconSrc());
        html.append(this.getLabel());
        + html.append(this.getIconSrc());
        html.append("</a>"); //$NON-NLS-1$
        return html.toString();
        }

      — originals/magnolia-2.1-SNAPSHOT/src/main/info/magnolia/cms/gui/dialog/DialogButtonSet.java 2005-07-13 17:15:01.000000000 +0200
      +++ patched//magnolia-2.1-SNAPSHOT/src/main/info/magnolia/cms/gui/dialog/DialogButtonSet.java 2005-07-24 15:02:18.000000000 +0200
      @@ -71,6 +71,12 @@
      Button button = new Button(this.getName(), value);
      // if (n.getNodeData("label").isExist()) button.setLabel(n.getNodeData("label").getString());
      button.setLabel(label);
      +
      + String iconSrc = n.getNodeData("iconSrc").getString();
      + if ( !iconSrc.equals("") )

      { + button.setIconSrc( iconSrc ); + }

      +
      if (setDefaultSelected && n.getNodeData("selected").getBoolean())

      { //$NON-NLS-1$ button.setState(ControlSuper.BUTTONSTATE_PUSHED); }

      @@ -169,7 +175,10 @@
      control = new ButtonSet(this.getName(), this.getValue());
      }
      control.setButtonType(this.getButtonType());

      • control.setCssClass(CssConstants.CSSCLASS_BUTTONSETBUTTON);
        +
        + // maem: extension to allow for fine grained layout control. E.g. radio buttons with picture
        + control.setCssClass(this.getConfigValue( "cssClass", CssConstants.CSSCLASS_BUTTONSETBUTTON ) );
        +
        if (this.getConfigValue("saveInfo").equals("false")) { //$NON-NLS-1$ //$NON-NLS-2$ control.setSaveInfo(false); }

        Acceptance criteria

              pbaerfuss Philipp Bärfuss
              aemi Michael Aemisegger
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: