[ https://issues.apache.org/jira/browse/WICKET-2940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12964589#action_12964589 ]
Andera Del Bene commented on WICKET-2940: ----------------------------------------- Hi. To avoid this side effect we could use css class 'wicket-ajax-indicator' associated with AJAX indicator's span. Setting property 'position' to 'absolute' takes indicator out of the normal flow of the document, avoiding any layout problem. > Placeholder image for AJAX indicator in IndicatingAjaxButton > ------------------------------------------------------------ > > Key: WICKET-2940 > URL: https://issues.apache.org/jira/browse/WICKET-2940 > Project: Wicket > Issue Type: Improvement > Components: wicket > Affects Versions: 1.4.9 > Reporter: Pierre Wargnier > Priority: Minor > > The current IndicatingAjaxButton has a indicator that is set visible when > AJAX is running. This usually breaks the HTML. A solution given by other > frameworks like RichFaces is to have a "blank image" of the same size that is > visible when AJAX is not running. This function can be optional because it > adds mode HTML. > I managed to implement this (but the original Wicket AJAX author will find > cleaner ways to do it): > 1) I overloaded AjaxIndicatorAppender.onRendered to add another <span> with > the blank image. The ID is the same as the indicator + "blank". > 2) I created interface IAjaxIndicatorAware2 extending IAjaxIndicatorAware and > I made a IndicatingAjaxButton implementing this interface. > 3) I modified AjaxButton.generateCallbackScript like this: > On line 157: > boolean blankIndicator = getComponent() instanceof IAjaxIndicatorAware2; //to > test if the component has a placeholder > One line 169: > if(blankIndicator){ > hide += "wicketShow('" + indicatorId + > IAjaxIndicatorAware2.BLANK_SUFFIX + "');"; > } > On line 213: > StringBuilder sb = new > StringBuilder("wicketShow('").append(indicatorId).append("');"); > if(blankIndicator){ > > sb.append("wicketHide('").append(indicatorId).append(IAjaxIndicatorAware2.BLANK_SUFFIX).append("');"); > } > sb.append(call); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.