You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by gia <wi...@gmail.com> on 2012/11/08 10:14:25 UTC

Activity indicator with IAjaxIndicatorAware and with non inline CSS

Hi,

I use IAjaxIndicatorAware to implement an activity indicator as it is
described at  

http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/

It works fine. But when I put DIV's style in a separate CSS file (to avoid
inline styles) it lost styles from CSS file after clicking.

Is it possible to put an activity indicator styles in CSS file, not in
markup inline?

I use Wicket 1.5.8.

Thanks.




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by gia <wi...@gmail.com>.
I am sending zip file of my maven based java project
ajax_activity.zip
<http://apache-wicket.1842946.n4.nabble.com/file/n4653739/ajax_activity.zip>  



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653739.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by gia <wi...@gmail.com>.
with

<div id="spinner_css" style="opacity:
.5;display:none;position:absolute;top:0;left:0;z-index=99999;background:grey
url(images/loadingn.gif) center center
no-repeat;width:100%;height:100%;color:red">

wicket will show it during ajax and hide it after ajax.

If I put style in CSS file wicket makes only ajax call without activity
indicator.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653723.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
and if you add style="display: none" it will not. And wicket will show it
during AJAX and hide it after AJAX.

On Thu, Nov 8, 2012 at 11:52 AM, gia <wi...@gmail.com> wrote:

> without    display: none;
>
> <div id="spinner_css"></div>
>
> is active (covers browser window) immediately after application startup
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653720.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>

Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by gia <wi...@gmail.com>.
without    display: none;

<div id="spinner_css"></div>

is active (covers browser window) immediately after application startup






--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653720.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
try

On Thu, Nov 8, 2012 at 11:25 AM, gia <wi...@gmail.com> wrote:

> Here is code
>
>  Markup:
>  <br>
>  <div id="spinner_css"></div>
>
>  <div id="spinner_css" style="display:none;"></div>


>  CSS:
> #spinner_css {
>     opacity: .5;
>     display: none;
>

get rid of display none;


>     position: absolute;
>     top: 0;
>     left: 0;
>     z-index = 99999;
>     background: grey url(../images/loadingn.gif) center center no-repeat;
>     width: 100%;
>     height: 100%;
>     color: red
> }
>
>  Java:
>  public class HPage extends WebPage implements IAjaxIndicatorAware {
>
>     private int ajaxcount = 0;
>
>     public HPage(final PageParameters parameters) {
>
>     ...
>
>         add(new ajaxLinkLabel("ajaxlinkcont", new
> PropertyModel<String>(this, "ajaxcount")) {
>             private static final long serialVersionUID = 1L;
>
>             @Override
>             public void onLabelClick(AjaxRequestTarget target) {
>                 try { Thread.sleep(5000); } catch(Exception e) {}
>                 ajaxcount++;
>                 target.add(this);
>             }
>         }.setOutputMarkupId(true));
>      ...
>      }
>
>
>             @Override
>             public String getAjaxIndicatorMarkupId() {
>                 return "spinner_css";
>     }
>    }
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653715.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>

Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by gia <wi...@gmail.com>.
 Markup is
 <br>
 <div id="spinner_css"></div>

Sorry, it was not complete in previous post.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653718.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by gia <wi...@gmail.com>.
Here is code

 Markup:
 <br>
 <div id="spinner_css"></div>

 CSS:
#spinner_css {
    opacity: .5;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index = 99999;
    background: grey url(../images/loadingn.gif) center center no-repeat;
    width: 100%;
    height: 100%;
    color: red
}

 Java:
 public class HPage extends WebPage implements IAjaxIndicatorAware {

    private int ajaxcount = 0;

    public HPage(final PageParameters parameters) {
  
    ...

        add(new ajaxLinkLabel("ajaxlinkcont", new
PropertyModel<String>(this, "ajaxcount")) {
            private static final long serialVersionUID = 1L;

            @Override
            public void onLabelClick(AjaxRequestTarget target) {
                try { Thread.sleep(5000); } catch(Exception e) {}
                ajaxcount++;
                target.add(this);
            }
        }.setOutputMarkupId(true));
     ...
     }
        
        
            @Override
	    public String getAjaxIndicatorMarkupId() {
	        return "spinner_css";
    }
   }  



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653715.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by Martin Grigorov <mg...@apache.org>.
Do you make the link invisible and then repaint it ?
Please show us your code.


On Thu, Nov 8, 2012 at 12:02 PM, gia <wi...@gmail.com> wrote:

> Hi,
>
>  DIV tag gets all styles from CSS file after application is loaded (I
> checked from firebug).
>  But when I click link it lost styles from CSS file and gets: display:
> none;
>
>  I have in markup
>
>  <head>
>     <link rel="stylesheet" href="css/style.css" type="text/css"
> media="screen" title="Stylesheet" />
>  </head>
>
>  I put style.css in src/main/webapp/css folder.
>
>  Thanks.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653713.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by gia <wi...@gmail.com>.
Hi,

 DIV tag gets all styles from CSS file after application is loaded (I
checked from firebug).
 But when I click link it lost styles from CSS file and gets: display: none;

 I have in markup 

 <head>
    <link rel="stylesheet" href="css/style.css" type="text/css"
media="screen" title="Stylesheet" />
 </head>

 I put style.css in src/main/webapp/css folder.
 
 Thanks.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708p4653713.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Activity indicator with IAjaxIndicatorAware and with non inline CSS

Posted by Sven Meier <sv...@meiers.net>.
Hi,

 > activity indicator styles in CSS file, not in markup inline

that should make no difference.

 > it lost styles from CSS file after clicking.

Does this happen only when you're using the activity indicator?

Sven

On 11/08/2012 10:14 AM, gia wrote:
> Hi,
>
> I use IAjaxIndicatorAware to implement an activity indicator as it is
> described at
>
> http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/
>
> It works fine. But when I put DIV's style in a separate CSS file (to avoid
> inline styles) it lost styles from CSS file after clicking.
>
> Is it possible to put an activity indicator styles in CSS file, not in
> markup inline?
>
> I use Wicket 1.5.8.
>
> Thanks.
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Activity-indicator-with-IAjaxIndicatorAware-and-with-non-inline-CSS-tp4653708.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org