Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
[BZ 1125972] - JON 3.3 Administration/Affinity Groups page is incorre…
Browse files Browse the repository at this point in the history
…ct. Button is missing to create new affinity group - This issue was caused by spaces in id (BaseWidget.setID())
  • Loading branch information
jkremser committed Aug 5, 2014
1 parent 4f83fee commit ca1a0fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public void executeAction(final ListGridRecord[] selections, Object actionValue)
}
});

addTableAction(MSG.view_adminTopology_server_removeSelected(), null, ButtonColor.RED,
new AuthorizedTableAction(this, TableActionEnablement.ANY, Permission.MANAGE_SETTINGS) {
addTableAction(MSG.view_adminTopology_server_removeSelected(), ButtonColor.RED, new AuthorizedTableAction(this,
TableActionEnablement.ANY, Permission.MANAGE_SETTINGS) {
public void executeAction(final ListGridRecord[] selections, Object actionValue) {
final List<String> selectedNames = getSelectedNames(selections);
String message = MSG.view_adminTopology_message_removeAGroupsConfirm(selectedNames.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,25 +610,7 @@ private void drawFooter() {

if (null == tableAction.getValueMap()) {
// button action
IButton button = new EnhancedIButton(tableAction.getTitle());
// set the id prefix to be able to match in css on this element
if (tableAction.getButtonColor() != null) {
switch (tableAction.getButtonColor()) {
case BLUE:
button.setID("primary" + id + tableAction.getTitle());
break;
case RED:
button.setID("destructive" + id + tableAction.getTitle());
break;
default:
break;
}
}
// just in case, someone forgot to explicitly set the red color (works only for English)
if (tableAction.getTitle().toLowerCase().contains("delete")
|| tableAction.getTitle().toLowerCase().contains("remove")) {
button.setID("destructive" + id + tableAction.getTitle());
}
IButton button = new EnhancedIButton(tableAction.getTitle(), tableAction.getButtonColor());
button.setTooltip(tableAction.getTooltip());
button.setDisabled(true);
button.setOverflow(Overflow.VISIBLE);
Expand Down Expand Up @@ -676,7 +658,7 @@ public void onClick(MenuItemClickEvent event) {
}

IMenuButton menuButton = new IMenuButton(tableAction.getTitle());
menuButton.setID("menuButton" + id + tableAction.getTitle());
menuButton.setID("menuButton" + id + tableAction.getTitle().replaceAll(" ", "_"));
menuButton.setTooltip(tableAction.getTooltip());
menuButton.setMenu(menu);
menuButton.setDisabled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public EnhancedIButton(String title) {
public EnhancedIButton(String title, ButtonColor buttonColor) {
super(title);
if (!ButtonColor.GRAY.equals(buttonColor)) {
setID((ButtonColor.BLUE.equals(buttonColor) ? "primary" : "destructive") + id + title);
// set the id prefix to be able to match in css on this element
setID((ButtonColor.BLUE.equals(buttonColor) ? "primary" : "destructive") + id + title.replaceAll(" ", "_"));
}
init();
}
Expand Down

0 comments on commit ca1a0fd

Please sign in to comment.