Thanks for the hint, Igor. I will have a look at channels. I don't 
remember seeing any information about these when I started my 
application (with Wicket 1.1). However, I suppose using channels does 
not prevent the user clicking on a regular link while an Ajax request is 
processed ?

Pierre-Yves

Igor Vaynberg a écrit :
> too bad you are blocking the entire window.
> 
> wicket has "ajax channels" with different channel modes such as 
> queue/disregard. that way you can disable certain groups of components 
> only by assigning them to the same ajax channel.
> 
> -Igor
> 
> 
> On 10/17/06, *Pierre-Yves Saumont* <[EMAIL PROTECTED] <mailto:[EMAIL 
> PROTECTED]>> 
> wrote:
> 
>     I found there are sevral things that I missed with Ajax links:
>     indicating that some activity is occuring, preventing the user to click
>     several times on the link, and warning the user if something is going
>     wrong (most often, the session has expired). So I extended AjaxLink :
> 
>     public abstract class WaitingAjaxLink extends AjaxLink {
> 
>        final StringResourceModel sessionExpiredModel;
> 
>        protected WaitingAjaxLink(final String id) {
>          super(id);
>          // Load a message for expired session
>          sessionExpiredModel = new
>     StringResourceModel("MyApplication.sessionExpired", this, null);
>        }
> 
>        protected wicket.ajax.IAjaxCallDecorator getAjaxCallDecorator() {
>          return new AjaxCallDecorator() {
>            public CharSequence decorateOnSuccessScript(CharSequence
>     script) {
>              return "ajaxSuccess()";
>            }
>            public CharSequence decorateOnFailureScript(CharSequence
>     script) {
>              String onFailureMessage =
>     WaitingAjaxLink.this.sessionExpiredModel.getString();
>              return "ajaxFailure('" + onFailureMessage + "')";
>            }
>            public CharSequence decorateScript(CharSequence script) {
>              return "beforeAjaxCall();" + script;
>            }
>          };
>        }
>     }
> 
>     Here are the JavaScript fucntions:
> 
>          function ajaxFailure(message) {
>            if (document.getElementById) {
>              Mask = document.getElementById('ajaxCallMask');
>              Mask.style.display = 'none';
>            }
>            alert(message);
>          }
>          function ajaxSuccess() {
>            if (document.getElementById) {
>              Mask = document.getElementById('ajaxCallMask');
>              Mask.style.display = 'none';
>            }
>          }
>          function beforeAjaxCall() {
>            if (document.getElementById) {
>              Mask = document.getElementById ('ajaxCallMask');
>              Mask.style.display = 'block';
>            }
>          }
> 
>     The element called 'ajaxCallMask' is a div that cover the whole page to
>     prevent the user from clicking on anything. It can contain an animated
>     gif showing activity.
> 
> 
>     Pierre-Yves
> 
> 
> 
> 
>     Marc-Andre Houle a écrit :
>      > Thanks, it is what I was looking for.  I'm not sure I am ready to
>     dive
>      > directly into Javascript like that, but to know it is possible is
>      > interesting.
>      >
>      > Thanks a lot for the quick answer.
>      >
>      > Marc
>      >
>      > On 10/17/06, *Igor Vaynberg* <[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>
>      > <mailto: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>> wrote:
>      >
>      >     yes
>      >
>      >     you need to write your own javascript - wicket has hooks there
>      >
>      >     see
>      >
>      >     Wicket.Ajax.registerPre/PostCallHandler
>      >
>      >     and
>      >
>      >     Wicket.Ajax.registerFailureHandler
>      >
>      >     in wicket-ajax.js
>      >
>      >     you can use those to toggle visibility of some page-wide
>      >     "loading..." indicator
>      >
>      >     -Igor
>      >
>      >
>      >     On 10/17/06, *Marc-Andre Houle* < [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>
>      >     <mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>      >
>      >         I was looking at Gmail and I think my example is bad.  I
>     think I
>      >         just said another stupid thing and gmail is "actually"
>     changing
>      >         all the page.
>      >
>      >         Anyway, the question is the same, is there a way to make a
>      >         feedback for "all" ajax call.
>      >
>      >
>      >         On 10/17/06, *Marc-Andre Houle* < [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>
>      >         <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>      >
>      >             I have checked what is avalaible from the Ajax
>     exemple and I
>      >             also searched the API to see if there is something to
>     make
>      >             the browser make a little feedback during an ajax call.
>      >             I want the browser to react like if something is
>     happening
>      >             during an ajax Call.  The fact is : when the server is
>      >             loaded and the response time is high, I don't want
>     the user
>      >             to think everything is death.  I want the user to think
>      >             something is happening, the answer will be there
>     shortly.
>      >
>      >             For this, there are IndicatingAjaxLink and the same for
>      >             submit button.  But, in our application, there is a
>     lot of
>      >             different Ajax call then simple link.  Like we have
>     an AJAX
>      >             tree with links, we use the AjaxPagingNavigator and
>     Ajax tab
>      >             panel.  All those, I'm not sure I want to reimplement
>     them.
>      >
>      >             What I am looking for is maybe something a little like
>      >             Gmail.  When you change from one place to the other,
>     it is
>      >             an ajax call and the page does not relad
>     completly.  But the
>      >             browser give sign that it is loading something like
>     if it
>      >             were a click on a normal link.  I'm not sure I am
>     clear on
>      >             this, but for me, it would be something really
>     interesting
>      >             to have a way identical for each ajax call to tell
>     the user
>      >             the page is currently refreshing.
>      >
>      >             Is there something like that that exist right now?
>      >
>      >             Marc
>      >
>      >
>      >
>      >        
>     -------------------------------------------------------------------------
> 
>      >         Using Tomcat but need to do more? Need to support web
>     services,
>      >         security?
>      >         Get stuff done quickly with pre-integrated technology to make
>      >         your job easier
>      >         Download IBM WebSphere Application Server v.1.0.1 based on
>      >         Apache Geronimo
>      >        
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>      >        
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>>
>      >
>      >         _______________________________________________
>      >         Wicket-user mailing list
>      >         [email protected]
>     <mailto:[email protected]>
>      >         <mailto: [email protected]
>     <mailto:[email protected]>>
>      >         https://lists.sourceforge.net/lists/listinfo/wicket-user
>     <https://lists.sourceforge.net/lists/listinfo/wicket-user>
>      >         <https://lists.sourceforge.net/lists/listinfo/wicket-user>
>      >
>      >
>      >
>      >
>      >    
>     -------------------------------------------------------------------------
> 
>      >     Using Tomcat but need to do more? Need to support web services,
>      >     security?
>      >     Get stuff done quickly with pre-integrated technology to make
>     your
>      >     job easier
>      >     Download IBM WebSphere Application Server v.1.0.1 based on Apache
>      >     Geronimo
>      >    
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>      >    
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>>
>      >
>      >     _______________________________________________
>      >     Wicket-user mailing list
>      >     [email protected]
>     <mailto:[email protected]>
>      >     <mailto:[email protected]
>     <mailto:[email protected]>>
>      >     https://lists.sourceforge.net/lists/listinfo/wicket-user
>      >     < https://lists.sourceforge.net/lists/listinfo/wicket-user>
>      >
>      >
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      >
>      >
>     -------------------------------------------------------------------------
> 
>      > Using Tomcat but need to do more? Need to support web services,
>     security?
>      > Get stuff done quickly with pre-integrated technology to make
>     your job easier
>      > Download IBM WebSphere Application Server v.1.0.1 based on Apache
>     Geronimo
>      >
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      >
>      > _______________________________________________
>      > Wicket-user mailing list
>      > [email protected]
>     <mailto:[email protected]>
>      > https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 
>     -------------------------------------------------------------------------
> 
>     Using Tomcat but need to do more? Need to support web services,
>     security?
>     Get stuff done quickly with pre-integrated technology to make your
>     job easier
>     Download IBM WebSphere Application Server v.1.0.1 based on Apache
>     Geronimo
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>     _______________________________________________
>     Wicket-user mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/wicket-user
>     <https://lists.sourceforge.net/lists/listinfo/wicket-user>
> 
> 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to