[MAGNOLIA-499] Allow for images to illustrate options in ButtonSet Controls (Radio buttons, Checkbox buttons) Created: 24/Jul/05  Updated: 17/Mar/09  Resolved: 26/Jul/05

Status: Closed
Project: Magnolia
Component/s: templating
Affects Version/s: 2.1 Final
Fix Version/s: 2.1 Final

Type: New Feature Priority: Major
Reporter: Michael Aemisegger Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

all


Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

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); }


 Comments   
Comment by Michael Aemisegger [ 24/Jul/05 ]

(Please note, that above it should read:

  • a custom css class can be configured through the property 'cssClass' in the dialog definition )

An example for custom css classes is:

a.pgnlDialogButtonsetButtonWithImage img

{ border: 0px; margin: 10px 0; display: block; }

a.pgnlDialogButtonsetButtonWithImage { }

For the property 'cssClass' in the dialog definition you then would set

pgnlDialogButtonsetButtonWithImage mgnlDialogButtonsetButton

Of course this can be simplified if this feature was incorporated in the trunk.

Comment by Philipp Bracher [ 25/Jul/05 ]

commited. please use the revision number for patches

Thanks

Comment by Boris Kraft [ 26/Jul/05 ]

reassigned to RC3

Generated at Mon Feb 12 03:18:02 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.