You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2010/11/28 23:18:27 UTC

[jira] Resolved: (WICKET-2940) Placeholder image for AJAX indicator in IndicatingAjaxButton

     [ https://issues.apache.org/jira/browse/WICKET-2940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2940.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

yes, either position:absolute or simply setting the width and height css properties works as well, depending on how you want the indicator to show up.

> 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
>            Assignee: Igor Vaynberg
>            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.