You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Per Newgro <pe...@gmx.ch> on 2007/12/21 22:40:40 UTC
How can i present a busy component
Hi *,
i have a page with some panels. On one panel there is a button. If this is
clicked a long running task is executed. The problem is that the cursor is
still a pointer and the browser seems to do nothing. This happens until the
long running task is ended. Then the panel components will be refreshed.
I would like at least to bring the little clock icon to my pointer. But how
should i do that?
Another much better solution would be if i could overlay the panel with a grey
fog. I experimented already with this but couldn't find a usable solution.
Maybe someone can give me a hint where i can start to search.
Thanks
Per
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How can i present a busy component
Posted by Christian Alejandro Marquez Grabia <ch...@gmail.com>.
Yes...that is another way (I forgot about it)
I remember I used it once....but changed it to my previous proposal (request
to change the way it was shown), it was simple to use.
Rgds,
Chris
On 12/27/07, Michael Sparer <mi...@gmx.at> wrote:
>
>
> what about using a IndicatingAjaxLink or IndicatingAjaxButton or a custom
> implemenation using a WicketAjaxIndicatorAppender (I think it's called
> like
> that)?
>
>
> Newgro wrote:
> >
> > Hi *,
> >
> > i have a page with some panels. On one panel there is a button. If this
> is
> > clicked a long running task is executed. The problem is that the cursor
> is
> > still a pointer and the browser seems to do nothing. This happens until
> > the
> > long running task is ended. Then the panel components will be refreshed.
> >
> > I would like at least to bring the little clock icon to my pointer. But
> > how
> > should i do that?
> > Another much better solution would be if i could overlay the panel with
> a
> > grey
> > fog. I experimented already with this but couldn't find a usable
> solution.
> > Maybe someone can give me a hint where i can start to search.
> >
> > Thanks
> > Per
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
>
>
> -----
> Michael Sparer
> http://talk-on-tech.blogspot.com
> --
> View this message in context:
> http://www.nabble.com/How-can-i-present-a-busy-component-tp14462974p14515327.html
> Sent from the Wicket - User 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: How can i present a busy component
Posted by Michael Sparer <mi...@gmx.at>.
what about using a IndicatingAjaxLink or IndicatingAjaxButton or a custom
implemenation using a WicketAjaxIndicatorAppender (I think it's called like
that)?
Newgro wrote:
>
> Hi *,
>
> i have a page with some panels. On one panel there is a button. If this is
> clicked a long running task is executed. The problem is that the cursor is
> still a pointer and the browser seems to do nothing. This happens until
> the
> long running task is ended. Then the panel components will be refreshed.
>
> I would like at least to bring the little clock icon to my pointer. But
> how
> should i do that?
> Another much better solution would be if i could overlay the panel with a
> grey
> fog. I experimented already with this but couldn't find a usable solution.
> Maybe someone can give me a hint where i can start to search.
>
> Thanks
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
-----
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context: http://www.nabble.com/How-can-i-present-a-busy-component-tp14462974p14515327.html
Sent from the Wicket - User 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: How can i present a busy component
Posted by Christian Alejandro Marquez Grabia <ch...@gmail.com>.
It looks fine for me....I never used that code to change the cursor....maybe
you should try something else to check if it works...I called my function to
hide / show a span, and it works for me (remember, I used 1.2.6), instead of
changing cursor style.
I really don't know what else to say, since as I can see, it should get the
job done.
Rgds,
Chris
On 12/22/07, Per Newgro <pe...@gmx.ch> wrote:
>
> Hi Christian Alejandro Marquez Grabia
>
> this looked promising but it's not working here. Am i missing something?
> I use wicket 1.3-rc1 and added my link this way
>
>
> add(new AjaxLink("aFogLink") {
> protected IAjaxCallDecorator getAjaxCallDecorator() {
> return new IAjaxCallDecorator() {
> public CharSequence decorateOnFailureScript(CharSequence pScript) {
> return "document.body.style.cursor = 'auto';";
> }
>
> public CharSequence decorateOnSuccessScript(CharSequence pScript) {
> return "document.body.style.cursor = 'auto';";
> }
>
> public CharSequence decorateScript(CharSequence pScript) {
> return pScript + "document.body.style.cursor = 'wait';";
> }
> };
> }
>
> public void onClick(AjaxRequestTarget pTarget) {
> new Thread() {
> public void run() {
> synchronized (this) {
> try {
> System.out.println("Start");
> wait(12000);
> System.out.println("Stop");
> } catch (InterruptedException e) {
> e.printStackTrace();
> }
> }
> }
> }.start();
> }
> });
> }
>
>
> Cheers
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: How can i present a busy component
Posted by Per Newgro <pe...@gmx.ch>.
Hi Christian Alejandro Marquez Grabia
this looked promising but it's not working here. Am i missing something?
I use wicket 1.3-rc1 and added my link this way
add(new AjaxLink("aFogLink") {
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new IAjaxCallDecorator() {
public CharSequence decorateOnFailureScript(CharSequence pScript) {
return "document.body.style.cursor = 'auto';";
}
public CharSequence decorateOnSuccessScript(CharSequence pScript) {
return "document.body.style.cursor = 'auto';";
}
public CharSequence decorateScript(CharSequence pScript) {
return pScript + "document.body.style.cursor = 'wait';";
}
};
}
public void onClick(AjaxRequestTarget pTarget) {
new Thread() {
public void run() {
synchronized (this) {
try {
System.out.println("Start");
wait(12000);
System.out.println("Stop");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}.start();
}
});
}
Cheers
Per
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How can i present a busy component
Posted by Christian Alejandro Marquez Grabia <ch...@gmail.com>.
Hi there, I did this on Wicket 1.2.6.
In the link I override the getCallDecorator() and return a new
IAjaxCallDecorator() { ... }
decorateScript(script): In here I appended before the script, the script to
show a sign (like gmail does) to show the user that something is loading.
decorateOnFailure(script) & decorateOnSuccess(script): In here I appended
(doesn't matter either is before or after) the script to hide the message.
Something more powerful like adding the shade to the calendar could be done
as well I guess...
Hope it helps or at least gives a hint. =)
Merry x-mas to e1 (everyone)
Chris
On 12/22/07, Per Newgro <pe...@gmx.ch> wrote:
>
> Thanks Sergey,
>
> > If there's a long time interval between button click and submission to
> > server, you could use javascript.
> The time between pressing the button and process starts is ok. The server
> /
> application is calculating some time. The task is: I build a calendar
> panel.
> On the panel there is a link for every day. If the day is clicked, the
> server
> calculates free rooms and updates the models etc. But this takes a while.
> And
> this time i would like to present a fog over my calendar panel.
>
> Tanks again
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: How can i present a busy component
Posted by Per Newgro <pe...@gmx.ch>.
Thanks Sergey,
> If there's a long time interval between button click and submission to
> server, you could use javascript.
The time between pressing the button and process starts is ok. The server /
application is calculating some time. The task is: I build a calendar panel.
On the panel there is a link for every day. If the day is clicked, the server
calculates free rooms and updates the models etc. But this takes a while. And
this time i would like to present a fog over my calendar panel.
Tanks again
Per
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How can i present a busy component
Posted by Sergey Podatelev <br...@gmail.com>.
>
> On Dec 21, 2007 10:40 PM, Per Newgro <pe...@gmx.ch> wrote:
>
> On one panel there is a button. If this is
> clicked a long running task is executed.
>
The problem is that the cursor is
> still a pointer and the browser seems to do nothing.
>
If there's a long time interval between button click and submission to
server, you could use javascript.
For example: <button onclick="this.style.cursor='wait';">.
To make a "fog" you need to overlay your button with a <div id="fog"> with
the following properties:
#fog {
opacity: .8; /* Gecko */
filter: alpha(opacity=80); /* IE */
width: 100%;
display: none;
position: absolute;
...other options, putting your overlaying element to where it's supposed to
be
}
Then <button onclick="document.getElementById
('fog').style.display='block';">.
If you're using a javascript framework you should check it for handy
solutions like $() instead of getElementById() or toggle() instead of
addressing to style.display, etc.
--
sp
Re: How can i present a busy component
Posted by Gerolf Seitz <ge...@gmail.com>.
hi,
depending on what you consider useful, maybe this[0] helps.
notice: currently doesn't work for IE. look at the _syncMask function in
[1]
to see how to make it work.
hth,
gerolf
[0] http://papernapkin.org/pastebin/view/16170/
[1] http://com3.devnet.re3.yahoo.com/yui/docs/CalendarNavigator.js.html
On Dec 21, 2007 10:40 PM, Per Newgro <pe...@gmx.ch> wrote:
> Hi *,
>
> i have a page with some panels. On one panel there is a button. If this is
> clicked a long running task is executed. The problem is that the cursor is
> still a pointer and the browser seems to do nothing. This happens until
> the
> long running task is ended. Then the panel components will be refreshed.
>
> I would like at least to bring the little clock icon to my pointer. But
> how
> should i do that?
> Another much better solution would be if i could overlay the panel with a
> grey
> fog. I experimented already with this but couldn't find a usable solution.
> Maybe someone can give me a hint where i can start to search.
>
> Thanks
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>