Re: AjaxSubmitLink not calling the onsubmit event handler

2010-03-27 Thread Richard Nichols
Yeah, maybe one of the wicket devs could comment on whether this is
expected behaviour?

In any case, I have built a workaround as part of my open source
http://code.google.com/p/visural-wicket/ project.

See - 
http://code.google.com/p/visural-wicket/source/browse/trunk/visural-wicket/src/com/visural/wicket/util/InvokeClientSideFormSubmitHandlerDecorator.java

This AjaxCallDecorator will invoke the form's onsubmit handler prior
to invoking the ajax call.

So you can:

add(new AjaxSubmitLink(blah) {
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new InvokeClientSideFormSubmitHandlerDecorator(MyForm.this);
}
});

And have any ajax submission work the same as SubmitLink / SubmitButton.

On 26 March 2010 19:51, Anantha Kumaran ananthakuma...@gmail.com wrote:
 Did you get a resolution to this issue? I have the same problem.


        currently i am using this techniques to do the my stuff.But it
 breaks when the user press return key.

              // save this so we can call it later
 var wicketOnClick = ajaxSubmitLink.onclick;
 ajaxSubmitLink.onclick = function() {
                         // do your stuff
  return wicketOnClick();
 };

 Is this expected behavior I wonder, or a bug?


 SubmitLink will call the form's onsubmit='???' handler,
 AjaxSubmitLink does not.


 AFAIK AjaxSubmitLink doesn't fire the submit event. Is serializes the form
 data and then makes a post call. I guess this
  can't be fixed easily because wicket is using *inline event registration
 model*.




 On 4 January 2010 23:05, Anantha Kumaran ananthakuma...@gmail.com wrote:
  hi pieter
 
  my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
  which calls the onsubmit before submitting
  the form.currently i am using the mousedown(can't use onclick) of the
  AjaxSubmitLink to do the validation stuffs but it breaks when the user
  submit the form by pressing the return.
 
 
 
 
  On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe 
  pieter.degrae...@systemworks.be wrote:
 
  If you want to do some additional stuff, you can do it in the form a a
  Behaviour.. I did use such behaviour to ask a javascript confirm. If
 user
  does not confirm, the form is not submitted.
 
  new AttributeModifier(onclick, true, new ModelString(if
 (!confirm(' +
  msg + ')) { /* do some additional stuff if not confirmed*/return;} else
 {
  /*do some stuff beform submitting the form*/})) {
            �...@override
             protected String newValue(String currentValue, String
  replacementValue) {
                 return replacementValue + currentValue;
             }
         };
 
  On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran 
 ananthakuma...@gmail.com
  wrote:
 
   is there any way to do this on the client side.I want to do some
 client
   side
   stuff before submitting the form.
  
   On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
   wicket.program...@gmail.com
wrote:
  
   
form.add ( new AjaxSubmitLink(){
   
protected void onSubmit(AjaxRequestTarget target, Form form){
  // Add  feedback and do ajax stuff.
}
   
protected void onError(AjaxRequestTarget target, Form form){
  // Add FeedbackPanel here
  target.add( feedback );
}});
--
View this message in context:
   
  
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
Sent from the Wicket - User mailing list archive at Nabble.com.
   
   
   
 -
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
  
 
 
 
  --
  Pieter Degraeuwe
  Systemworks bvba
  Belgiëlaan 61
  9070 Destelbergen
  GSM: +32 (0)485/68.60.85
  Email: pieter.degrae...@systemworks.be
  visit us at http://www.systemworks.be
 
 



 --
 Richard Nichols :: http://www.visural.com/ ::
 http://www.richardnichols.net/

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




 --
 
 Anantha Kumaran(http://ananthakumaran.github.com)




-- 
Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/

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



Re: AjaxSubmitLink not calling the onsubmit event handler

2010-03-27 Thread Igor Vaynberg
open an rfe

-igor

On Fri, Mar 26, 2010 at 11:12 PM, Richard Nichols r...@richardnichols.net 
wrote:
 Yeah, maybe one of the wicket devs could comment on whether this is
 expected behaviour?

 In any case, I have built a workaround as part of my open source
 http://code.google.com/p/visural-wicket/ project.

 See - 
 http://code.google.com/p/visural-wicket/source/browse/trunk/visural-wicket/src/com/visural/wicket/util/InvokeClientSideFormSubmitHandlerDecorator.java

 This AjaxCallDecorator will invoke the form's onsubmit handler prior
 to invoking the ajax call.

 So you can:

 add(new AjaxSubmitLink(blah) {
       �...@override
        protected IAjaxCallDecorator getAjaxCallDecorator() {
            return new InvokeClientSideFormSubmitHandlerDecorator(MyForm.this);
        }
 });

 And have any ajax submission work the same as SubmitLink / SubmitButton.

 On 26 March 2010 19:51, Anantha Kumaran ananthakuma...@gmail.com wrote:
 Did you get a resolution to this issue? I have the same problem.


        currently i am using this techniques to do the my stuff.But it
 breaks when the user press return key.

              // save this so we can call it later
 var wicketOnClick = ajaxSubmitLink.onclick;
 ajaxSubmitLink.onclick = function() {
                         // do your stuff
  return wicketOnClick();
 };

 Is this expected behavior I wonder, or a bug?


 SubmitLink will call the form's onsubmit='???' handler,
 AjaxSubmitLink does not.


 AFAIK AjaxSubmitLink doesn't fire the submit event. Is serializes the form
 data and then makes a post call. I guess this
  can't be fixed easily because wicket is using *inline event registration
 model*.




 On 4 January 2010 23:05, Anantha Kumaran ananthakuma...@gmail.com wrote:
  hi pieter
 
  my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
  which calls the onsubmit before submitting
  the form.currently i am using the mousedown(can't use onclick) of the
  AjaxSubmitLink to do the validation stuffs but it breaks when the user
  submit the form by pressing the return.
 
 
 
 
  On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe 
  pieter.degrae...@systemworks.be wrote:
 
  If you want to do some additional stuff, you can do it in the form a a
  Behaviour.. I did use such behaviour to ask a javascript confirm. If
 user
  does not confirm, the form is not submitted.
 
  new AttributeModifier(onclick, true, new ModelString(if
 (!confirm(' +
  msg + ')) { /* do some additional stuff if not confirmed*/return;} else
 {
  /*do some stuff beform submitting the form*/})) {
            �...@override
             protected String newValue(String currentValue, String
  replacementValue) {
                 return replacementValue + currentValue;
             }
         };
 
  On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran 
 ananthakuma...@gmail.com
  wrote:
 
   is there any way to do this on the client side.I want to do some
 client
   side
   stuff before submitting the form.
  
   On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
   wicket.program...@gmail.com
wrote:
  
   
form.add ( new AjaxSubmitLink(){
   
protected void onSubmit(AjaxRequestTarget target, Form form){
  // Add  feedback and do ajax stuff.
}
   
protected void onError(AjaxRequestTarget target, Form form){
  // Add FeedbackPanel here
  target.add( feedback );
}});
--
View this message in context:
   
  
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
Sent from the Wicket - User mailing list archive at Nabble.com.
   
   
   
 -
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
  
 
 
 
  --
  Pieter Degraeuwe
  Systemworks bvba
  Belgiëlaan 61
  9070 Destelbergen
  GSM: +32 (0)485/68.60.85
  Email: pieter.degrae...@systemworks.be
  visit us at http://www.systemworks.be
 
 



 --
 Richard Nichols :: http://www.visural.com/ ::
 http://www.richardnichols.net/

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




 --
 
 Anantha Kumaran(http://ananthakumaran.github.com)




 --
 Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/

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



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



Re: AjaxSubmitLink not calling the onsubmit event handler

2010-03-26 Thread Anantha Kumaran
Did you get a resolution to this issue? I have the same problem.


currently i am using this techniques to do the my stuff.But it
breaks when the user press return key.

  // save this so we can call it later
var wicketOnClick = ajaxSubmitLink.onclick;
ajaxSubmitLink.onclick = function() {
 // do your stuff
 return wicketOnClick();
};

Is this expected behavior I wonder, or a bug?


 SubmitLink will call the form's onsubmit='???' handler,
 AjaxSubmitLink does not.


AFAIK AjaxSubmitLink doesn't fire the submit event. Is serializes the form
data and then makes a post call. I guess this
 can't be fixed easily because wicket is using *inline event registration
model*.




 On 4 January 2010 23:05, Anantha Kumaran ananthakuma...@gmail.com wrote:
  hi pieter
 
  my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
  which calls the onsubmit before submitting
  the form.currently i am using the mousedown(can't use onclick) of the
  AjaxSubmitLink to do the validation stuffs but it breaks when the user
  submit the form by pressing the return.
 
 
 
 
  On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe 
  pieter.degrae...@systemworks.be wrote:
 
  If you want to do some additional stuff, you can do it in the form a a
  Behaviour.. I did use such behaviour to ask a javascript confirm. If
 user
  does not confirm, the form is not submitted.
 
  new AttributeModifier(onclick, true, new ModelString(if
 (!confirm(' +
  msg + ')) { /* do some additional stuff if not confirmed*/return;} else
 {
  /*do some stuff beform submitting the form*/})) {
 @Override
 protected String newValue(String currentValue, String
  replacementValue) {
 return replacementValue + currentValue;
 }
 };
 
  On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran 
 ananthakuma...@gmail.com
  wrote:
 
   is there any way to do this on the client side.I want to do some
 client
   side
   stuff before submitting the form.
  
   On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
   wicket.program...@gmail.com
wrote:
  
   
form.add ( new AjaxSubmitLink(){
   
protected void onSubmit(AjaxRequestTarget target, Form form){
  // Add  feedback and do ajax stuff.
}
   
protected void onError(AjaxRequestTarget target, Form form){
  // Add FeedbackPanel here
  target.add( feedback );
}});
--
View this message in context:
   
  
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
Sent from the Wicket - User mailing list archive at Nabble.com.
   
   
   
 -
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
  
 
 
 
  --
  Pieter Degraeuwe
  Systemworks bvba
  Belgiëlaan 61
  9070 Destelbergen
  GSM: +32 (0)485/68.60.85
  Email: pieter.degrae...@systemworks.be
  visit us at http://www.systemworks.be
 
 



 --
 Richard Nichols :: http://www.visural.com/ ::
 http://www.richardnichols.net/

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




-- 

Anantha Kumaran(http://ananthakumaran.github.com)


Re: AjaxSubmitLink not calling the onsubmit event handler

2010-03-24 Thread Richard Nichols
Hi Anantha,

Did you get a resolution to this issue? I have the same problem.

Is this expected behavior I wonder, or a bug?

SubmitLink will call the form's onsubmit='???' handler,
AjaxSubmitLink does not.


On 4 January 2010 23:05, Anantha Kumaran ananthakuma...@gmail.com wrote:
 hi pieter

 my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
 which calls the onsubmit before submitting
 the form.currently i am using the mousedown(can't use onclick) of the
 AjaxSubmitLink to do the validation stuffs but it breaks when the user
 submit the form by pressing the return.




 On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe 
 pieter.degrae...@systemworks.be wrote:

 If you want to do some additional stuff, you can do it in the form a a
 Behaviour.. I did use such behaviour to ask a javascript confirm. If user
 does not confirm, the form is not submitted.

 new AttributeModifier(onclick, true, new ModelString(if (!confirm(' +
 msg + ')) { /* do some additional stuff if not confirmed*/return;} else {
 /*do some stuff beform submitting the form*/})) {
           �...@override
            protected String newValue(String currentValue, String
 replacementValue) {
                return replacementValue + currentValue;
            }
        };

 On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran ananthakuma...@gmail.com
 wrote:

  is there any way to do this on the client side.I want to do some client
  side
  stuff before submitting the form.
 
  On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
  wicket.program...@gmail.com
   wrote:
 
  
   form.add ( new AjaxSubmitLink(){
  
   protected void onSubmit(AjaxRequestTarget target, Form form){
     // Add  feedback and do ajax stuff.
   }
  
   protected void onError(AjaxRequestTarget target, Form form){
     // Add FeedbackPanel here
     target.add( feedback );
   }});
   --
   View this message in context:
  
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



 --
 Pieter Degraeuwe
 Systemworks bvba
 Belgiëlaan 61
 9070 Destelbergen
 GSM: +32 (0)485/68.60.85
 Email: pieter.degrae...@systemworks.be
 visit us at http://www.systemworks.be





-- 
Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/

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



Re: AjaxSubmitLink not calling the onsubmit event handler

2010-01-04 Thread Pieter Degraeuwe
If you want to do some additional stuff, you can do it in the form a a
Behaviour.. I did use such behaviour to ask a javascript confirm. If user
does not confirm, the form is not submitted.

new AttributeModifier(onclick, true, new ModelString(if (!confirm(' +
msg + ')) { /* do some additional stuff if not confirmed*/return;} else {
/*do some stuff beform submitting the form*/})) {
@Override
protected String newValue(String currentValue, String
replacementValue) {
return replacementValue + currentValue;
}
};

On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran ananthakuma...@gmail.comwrote:

 is there any way to do this on the client side.I want to do some client
 side
 stuff before submitting the form.

 On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
 wicket.program...@gmail.com
  wrote:

 
  form.add ( new AjaxSubmitLink(){
 
  protected void onSubmit(AjaxRequestTarget target, Form form){
// Add  feedback and do ajax stuff.
  }
 
  protected void onError(AjaxRequestTarget target, Form form){
// Add FeedbackPanel here
target.add( feedback );
  }});
  --
  View this message in context:
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




-- 
Pieter Degraeuwe
Systemworks bvba
Belgiëlaan 61
9070 Destelbergen
GSM: +32 (0)485/68.60.85
Email: pieter.degrae...@systemworks.be
visit us at http://www.systemworks.be


Re: AjaxSubmitLink not calling the onsubmit event handler

2010-01-04 Thread Anantha Kumaran
hi pieter

my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
which calls the onsubmit before submitting
the form.currently i am using the mousedown(can't use onclick) of the
AjaxSubmitLink to do the validation stuffs but it breaks when the user
submit the form by pressing the return.




On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe 
pieter.degrae...@systemworks.be wrote:

 If you want to do some additional stuff, you can do it in the form a a
 Behaviour.. I did use such behaviour to ask a javascript confirm. If user
 does not confirm, the form is not submitted.

 new AttributeModifier(onclick, true, new ModelString(if (!confirm(' +
 msg + ')) { /* do some additional stuff if not confirmed*/return;} else {
 /*do some stuff beform submitting the form*/})) {
@Override
protected String newValue(String currentValue, String
 replacementValue) {
return replacementValue + currentValue;
}
};

 On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran ananthakuma...@gmail.com
 wrote:

  is there any way to do this on the client side.I want to do some client
  side
  stuff before submitting the form.
 
  On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
  wicket.program...@gmail.com
   wrote:
 
  
   form.add ( new AjaxSubmitLink(){
  
   protected void onSubmit(AjaxRequestTarget target, Form form){
 // Add  feedback and do ajax stuff.
   }
  
   protected void onError(AjaxRequestTarget target, Form form){
 // Add FeedbackPanel here
 target.add( feedback );
   }});
   --
   View this message in context:
  
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



 --
 Pieter Degraeuwe
 Systemworks bvba
 Belgiëlaan 61
 9070 Destelbergen
 GSM: +32 (0)485/68.60.85
 Email: pieter.degrae...@systemworks.be
 visit us at http://www.systemworks.be



AjaxSubmitLink not calling the onsubmit event handler

2010-01-03 Thread Anantha Kumaran
Is it possible to add a onsubmit event to a form that is submitted using
AjaxSubmitLink?

if not so is there any other way to handle validation stuffs..


Re: AjaxSubmitLink not calling the onsubmit event handler

2010-01-03 Thread Mathias Nilsson

form.add ( new AjaxSubmitLink(){

protected void onSubmit(AjaxRequestTarget target, Form form){
   // Add  feedback and do ajax stuff.
}

protected void onError(AjaxRequestTarget target, Form form){
   // Add FeedbackPanel here
   target.add( feedback );
}});
-- 
View this message in context: 
http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: AjaxSubmitLink not calling the onsubmit event handler

2010-01-03 Thread Anantha Kumaran
is there any way to do this on the client side.I want to do some client side
stuff before submitting the form.

On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson wicket.program...@gmail.com
 wrote:


 form.add ( new AjaxSubmitLink(){

 protected void onSubmit(AjaxRequestTarget target, Form form){
   // Add  feedback and do ajax stuff.
 }

 protected void onError(AjaxRequestTarget target, Form form){
   // Add FeedbackPanel here
   target.add( feedback );
 }});
 --
 View this message in context:
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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