Re: Wicket 6 - test ajax component.

2015-07-22 Thread gump lee
Thanks for your reply. I would try to use other testing method to test my
component.
On Jul 21, 2015 4:47 PM, andrea del bene an.delb...@gmail.com wrote:

 Hi,

 I don't think it's possible to send a specific key as this requires
 JavaScript code to be executed. But you can test AJAX events:

 //simulate an AJAX click event
 tester.executeAjaxEvent(label, click);


 See 'Testing AJAX events' in the userguide for more details.

 Andrea.

 On 20/07/2015 16:27, gump lee wrote:

 Dear All,

 Is it possible to write a unit test with WicketTester which I need to send
 Enter key to an AJAX component?


 Best regards,
 Gump



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




Wicket 6 - test ajax component.

2015-07-20 Thread gump lee
Dear All,

Is it possible to write a unit test with WicketTester which I need to send
Enter key to an AJAX component?


Best regards,
Gump


Re: How to stop event propagation?

2015-07-09 Thread gump lee
Thanks,

Actually I did it. refer to my attached code, I register my
AjaxcallListener. Did I register the AjaxCallListener correctly?

On Thu, Jul 9, 2015 at 2:23 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 Hi,

 You need to register the AjaxCallListener:
 attributes.getAjaxCallListeners().add(myAjaxCallListener)

 Martin Grigorov
 Freelancer. Available for hire!
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Thu, Jul 9, 2015 at 5:11 AM, gump lee zeno@gmail.com wrote:

  Hello All,
 
  I am using Wicket 6.19. I added a
  AjaxFormComponentUpdatingBehavior(keypress)
  to a textfield so that when press any key will trigger my application to
  update something. I want this only happen when user press 'Enter' key. so
  that I override the method updateAjaxAttributes in the
  AjaxFormComponentUpdatingBehavior
 
  @Override
  protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
  super.updateAjaxAttributes(attributes);
  AjaxCallListener myAjaxCallListener = new AjaxCallListener() {
  @Override
  public CharSequence getPrecondition(Component component) {
  String script = var keycode = Wicket.Event.keyCode(attrs.event);
  + if (keycode == 13) {
  + return true;
  + } else { + return false;};
 
  return script;
  }
  };
  attributes.getAjaxCallListeners().add(myAjaxCallListener);
  attributes.setEventPropagation(EventPropagation.STOP);
  }
 
  However, after the ajax call, the form submit also triggered. Does anyone
  know the correct way to stop this form submit?
 
 
  Thanks and best regards,
  Gump
 



Re: How to stop event propagation?

2015-07-09 Thread gump lee
I use the following code to register the AjaxCallListener

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {

AjaxCallListener myAjaxCallListener = new AjaxCallListener() {
@Override
public CharSequence getPrecondition(Component component) {
String script = var keycode = Wicket.Event.keyCode(attrs.event);
+ if (keycode == 13) {
+ return true;
+ } else { + return false;};

return script;
}
};
* attributes.getAjaxCallListeners().add(myAjaxCallListener);*
attributes.setEventPropagation(EventPropagation.STOP);
super.updateAjaxAttributes(attributes);
}

or would you show me the correct way to register the AjaxCallListener?

On Thu, Jul 9, 2015 at 2:45 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 There is no attachment in both of your mails.
 I don't see this line in your first message.

 Martin Grigorov
 Freelancer. Available for hire!
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Thu, Jul 9, 2015 at 9:42 AM, gump lee zeno@gmail.com wrote:

  Thanks,
 
  Actually I did it. refer to my attached code, I register my
  AjaxcallListener. Did I register the AjaxCallListener correctly?
 
  On Thu, Jul 9, 2015 at 2:23 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   Hi,
  
   You need to register the AjaxCallListener:
   attributes.getAjaxCallListeners().add(myAjaxCallListener)
  
   Martin Grigorov
   Freelancer. Available for hire!
   Wicket Training and Consulting
   https://twitter.com/mtgrigorov
  
   On Thu, Jul 9, 2015 at 5:11 AM, gump lee zeno@gmail.com wrote:
  
Hello All,
   
I am using Wicket 6.19. I added a
AjaxFormComponentUpdatingBehavior(keypress)
to a textfield so that when press any key will trigger my application
  to
update something. I want this only happen when user press 'Enter'
 key.
  so
that I override the method updateAjaxAttributes in the
AjaxFormComponentUpdatingBehavior
   
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes
 attributes) {
super.updateAjaxAttributes(attributes);
AjaxCallListener myAjaxCallListener = new AjaxCallListener() {
@Override
public CharSequence getPrecondition(Component component) {
String script = var keycode = Wicket.Event.keyCode(attrs.event);
+ if (keycode == 13) {
+ return true;
+ } else { + return false;};
   
return script;
}
};
attributes.getAjaxCallListeners().add(myAjaxCallListener);
attributes.setEventPropagation(EventPropagation.STOP);
}
   
However, after the ajax call, the form submit also triggered. Does
  anyone
know the correct way to stop this form submit?
   
   
Thanks and best regards,
Gump
   
  
 



How to stop event propagation?

2015-07-08 Thread gump lee
Hello All,

I am using Wicket 6.19. I added a AjaxFormComponentUpdatingBehavior(keypress)
to a textfield so that when press any key will trigger my application to
update something. I want this only happen when user press 'Enter' key. so
that I override the method updateAjaxAttributes in the
AjaxFormComponentUpdatingBehavior

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
AjaxCallListener myAjaxCallListener = new AjaxCallListener() {
@Override
public CharSequence getPrecondition(Component component) {
String script = var keycode = Wicket.Event.keyCode(attrs.event);
+ if (keycode == 13) {
+ return true;
+ } else { + return false;};

return script;
}
};
attributes.getAjaxCallListeners().add(myAjaxCallListener);
attributes.setEventPropagation(EventPropagation.STOP);
}

However, after the ajax call, the form submit also triggered. Does anyone
know the correct way to stop this form submit?


Thanks and best regards,
Gump


Re: 6.0.x Docs Down?

2015-07-07 Thread gump lee
The link for 6.0 api still down.

http://ci.apache.org/projects/wicket/apidocs/6.x/

Where would I found the API document?


Thanks and best regards,
Gump


On Tue, Jun 30, 2015 at 1:54 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 https://blogs.apache.org/infra/entry/buildbot_master_currently_off_line
 On Jun 30, 2015 6:00 AM, kyabe_JP okabe.wic...@gmail.com wrote:

  I have failed to access to any apidocs page, e.g
  http://ci.apache.org/projects/wicket/apidocs/6.x/
  http://ci.apache.org/projects/wicket/apidocs/6.x/  .
 
  According to the past conversation, the BuildBot servers had been back.
 
  Am I looking wrong address or if it down again ?
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/6-0-x-Docs-Down-tp4665501p4671417.html
  Sent from the Users forum 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