diff --git a/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/spinner/SpinnerAjaxButton.java b/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/spinner/SpinnerAjaxButton.java index 887d6299e..4c7fc8ccc 100644 --- a/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/spinner/SpinnerAjaxButton.java +++ b/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/spinner/SpinnerAjaxButton.java @@ -105,9 +105,15 @@ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { @Override protected Component newLabel(String markupId, IModel model) { Component label = super.newLabel(markupId, model); + return label; + } + + @Override + protected void onConfigure() { + super.onConfigure(); + Component label = get("label"); if (Strings.isEmpty(label.getDefaultModelObjectAsString())) { - label.add(AttributeModifier.append("class", "sr-only")); + label.add(AttributeModifier.append("class", "sr-only")); } - return label; } } diff --git a/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/spinner/SpinnerAjaxLink.java b/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/spinner/SpinnerAjaxLink.java index b95410ff8..9f43409f0 100644 --- a/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/spinner/SpinnerAjaxLink.java +++ b/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/spinner/SpinnerAjaxLink.java @@ -94,9 +94,15 @@ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { protected Component newLabel(String markupId, IModel model) { Component label = super.newLabel(markupId, model); label.setRenderBodyOnly(false); + return label; + } + + @Override + protected void onConfigure() { + super.onConfigure(); + Component label = get("label"); if (Strings.isEmpty(label.getDefaultModelObjectAsString())) { - label.add(AttributeModifier.append("class", "sr-only")); + label.add(AttributeModifier.append("class", "sr-only")); } - return label; } }