Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 import static org.rauschig.wicketjs.jquery.JQuery.$;
A link that uses bootstrap's button JavaScript to load a default loading text. You can override the resource key indicator.loading-text to overwrite the default loading text used.

<T> Model object type
 public abstract class IndicatingButton<T> extends JsAjaxLink<T> {
     private static final long serialVersionUID = 1L;
     private IModel<StringloadingDisplayModel;
     public IndicatingButton(String id) {
     public IndicatingButton(String idIModel<T> model) {
     public IndicatingButton(String idIModel<T> modelIModel<StringloadingDisplayModel) {
         this. = loadingDisplayModel;

Sets the model used for showing the loading text.

model a string model
this for chaining
         this. = model;
         return this;

Returns the model used for showing the loading text.

a string model
     public IModel<StringgetLoadingDisplayModel() {
         return ;
     public IJavaScript onBefore() {
         return $(this).call("button""loading");
     public IJavaScript onComplete() {
         return $(this).call("button""reset");
     protected void onComponentTag(ComponentTag tag) {
         String loadingText = getLoadingText();
         if (loadingText != null) {

Loads the model object from the loadingDisplayModel.

a string to show as loading text
     private String getLoadingText() {
         IModel<Stringmodel = getLoadingDisplayModel();
         if (model == null) {
             return null;
         return model.getObject();
New to GrepCode? Check out our FAQ X