Re: DOM element not found issue - Ajax response

2014-04-04 Thread Ernesto Reinaldo Barreiro
Hi,

Are you blocking the UI during AJAX requests? I have seen similar weird
things happening because:

1- One AJAX request (R1) is executing.
2- UI is not blocked. User click on on something. A second AJAX (R2)
request is queue: as far as I understand AJAX request are queued by channel
(please, Martin, correct me if I'm telling something wrong).
3- R1 completes and does some DOM replacements.
4- R1 is sent and after server response tries to do something on DOM but R1
already replaced that element.

Try blocking the UI.

On Fri, Apr 4, 2014 at 7:22 AM, Rakesh A iamrakes...@rediffmail.com wrote:

 Hi,

 In my case, the DOM element is not part of iframe/modal window, its in the
 current page itself. And the 'id' attribute used by javascript is also part
 of the same Ajax response. And I am using JQuery to reference this DOM
 element.
 What I am doing is.
 1. Go to my page
 2. Press F5 to refresh my wicket page [unversioned], and wait for the page
 to load completely.
 3. Click on one AjaxLink which replaces another component in the same page.

 Step#3 here responds markup and Javascript [JQuery script], I see that the
 'id' attribute used by JQuery is part of the same Ajax response. But still
 JQuery fails to find this DOM element.

 There is another case where I get similar issue.
 When my application is deployed over network, and is accessed from a
 different machine [with some network lag]. On the page I've one AjaxLink 
 and Component with Ajax on click behavior added to it.
 1. Click on component with ajax on click behavior.
 2. Click on AjaxLink, without waiting for the first request to complete.

 The AjaxLink in both scenarios is the same link, and replaced another
 component.

 Thanks,
 Rakesh.A

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/DOM-element-not-found-issue-Ajax-response-tp4665201p4665258.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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: DOM element not found issue - Ajax response

2014-04-04 Thread Ernesto Reinaldo Barreiro
on 4- R1 is sent R2 is sent


On Fri, Apr 4, 2014 at 8:33 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi,

 Are you blocking the UI during AJAX requests? I have seen similar weird
 things happening because:

 1- One AJAX request (R1) is executing.
 2- UI is not blocked. User click on on something. A second AJAX (R2)
 request is queue: as far as I understand AJAX request are queued by channel
 (please, Martin, correct me if I'm telling something wrong).
 3- R1 completes and does some DOM replacements.
 4- R1 is sent and after server response tries to do something on DOM but
 R1 already replaced that element.

 Try blocking the UI.

 On Fri, Apr 4, 2014 at 7:22 AM, Rakesh A iamrakes...@rediffmail.comwrote:

 Hi,

 In my case, the DOM element is not part of iframe/modal window, its in the
 current page itself. And the 'id' attribute used by javascript is also
 part
 of the same Ajax response. And I am using JQuery to reference this DOM
 element.
 What I am doing is.
 1. Go to my page
 2. Press F5 to refresh my wicket page [unversioned], and wait for the page
 to load completely.
 3. Click on one AjaxLink which replaces another component in the same
 page.

 Step#3 here responds markup and Javascript [JQuery script], I see that the
 'id' attribute used by JQuery is part of the same Ajax response. But still
 JQuery fails to find this DOM element.

 There is another case where I get similar issue.
 When my application is deployed over network, and is accessed from a
 different machine [with some network lag]. On the page I've one AjaxLink 
 and Component with Ajax on click behavior added to it.
 1. Click on component with ajax on click behavior.
 2. Click on AjaxLink, without waiting for the first request to complete.

 The AjaxLink in both scenarios is the same link, and replaced another
 component.

 Thanks,
 Rakesh.A

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/DOM-element-not-found-issue-Ajax-response-tp4665201p4665258.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




 --
 Regards - Ernesto Reinaldo Barreiro




-- 
Regards - Ernesto Reinaldo Barreiro


Re: DOM element not found issue - Ajax response

2014-04-04 Thread Martin Grigorov
On Fri, Apr 4, 2014 at 8:33 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi,

 Are you blocking the UI during AJAX requests? I have seen similar weird
 things happening because:

 1- One AJAX request (R1) is executing.
 2- UI is not blocked. User click on on something. A second AJAX (R2)
 request is queue: as far as I understand AJAX request are queued by channel
 (please, Martin, correct me if I'm telling something wrong).


You are correct, Ernesto ! :)
By default all Ajax calls use the same channel name (0) and type (queue).
You can control this by using custom AjaxChannel -
AjaxRequestAttributes#setChannel().


 3- R1 completes and does some DOM replacements.
 4- R1 is sent and after server response tries to do something on DOM but R1
 already replaced that element.

 Try blocking the UI.

 On Fri, Apr 4, 2014 at 7:22 AM, Rakesh A iamrakes...@rediffmail.com
 wrote:

  Hi,
 
  In my case, the DOM element is not part of iframe/modal window, its in
 the
  current page itself. And the 'id' attribute used by javascript is also
 part
  of the same Ajax response. And I am using JQuery to reference this DOM
  element.
  What I am doing is.
  1. Go to my page
  2. Press F5 to refresh my wicket page [unversioned], and wait for the
 page
  to load completely.
  3. Click on one AjaxLink which replaces another component in the same
 page.
 
  Step#3 here responds markup and Javascript [JQuery script], I see that
 the
  'id' attribute used by JQuery is part of the same Ajax response. But
 still
  JQuery fails to find this DOM element.
 
  There is another case where I get similar issue.
  When my application is deployed over network, and is accessed from a
  different machine [with some network lag]. On the page I've one AjaxLink
 
  and Component with Ajax on click behavior added to it.
  1. Click on component with ajax on click behavior.
  2. Click on AjaxLink, without waiting for the first request to complete.
 
  The AjaxLink in both scenarios is the same link, and replaced another
  component.
 
  Thanks,
  Rakesh.A
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/DOM-element-not-found-issue-Ajax-response-tp4665201p4665258.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
 
 


 --
 Regards - Ernesto Reinaldo Barreiro



FormComponentPanel.validate() API Doc question

2014-04-04 Thread lucast
Dear forum,
I've written a FormComponentPanel in which one can select a date range and
during validation I want to check that start date is not in the past or that
end date is before start date.

I have decided to do these checks by overriding
FormComponentPanel.validate().

The FormComponentPanel.validate() API Documentation ends with *This method
should only be used if the form component needs to be fully validated
outside the form process.*

What exactly does *validate a component outside the form process* mean? 
English is not my first language so maybe that's why I don't get it.

All explanations will be much appreciated.

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FormComponentPanel-validate-API-Doc-question-tp4665262.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



Re: FormComponentPanel.validate() API Doc question

2014-04-04 Thread Sven Meier

Hi Lucas,

#validate() is called by the Form when it processes a request. Usually 
you don't call this method by yourself - that's all.
Overriding #validate() is OK. Note that a FormComponentPanel can have 
validators too, so it might be simpler to just add one for your date checks.


Regards
Sven

On 04/04/2014 01:31 PM, lucast wrote:

Dear forum,
I've written a FormComponentPanel in which one can select a date range and
during validation I want to check that start date is not in the past or that
end date is before start date.

I have decided to do these checks by overriding
FormComponentPanel.validate().

The FormComponentPanel.validate() API Documentation ends with *This method
should only be used if the form component needs to be fully validated
outside the form process.*

What exactly does *validate a component outside the form process* mean?
English is not my first language so maybe that's why I don't get it.

All explanations will be much appreciated.

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FormComponentPanel-validate-API-Doc-question-tp4665262.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




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



autocomplete + ajaxformcomponentupdate - mouseselection not working after error

2014-04-04 Thread haiko


Hi wicketusers,

I have an autocomplete textfield with an  
AjaxFormComponentUpdatingBehavior attached for the 'change' event.
After an error on the input the update is handled in the onError  
method -- ( some pseudocode )


autocompletefield.add(new AjaxFormComponentUpdatingBehavior(change) {

.

protected void onError(AjaxRequestTarget target,  
RuntimeException re) {
   autocompletefield.add(new  
AttributeModifier(CLASS_ATTRIBUTE, AUTOCOMPLETE_INVALID_CLASS));

   target.add(autocompletefield);
}

Here is the autocompletefield replaced by an updated version with a  
new class attribute.


The problem is that a mouseselection of a listitem in the dropdown is  
not selected. A mouseselection just closes the autocomplete window.  
Selection with the keyboard works just fine.


Any suggestions how to tackle this problem?

Thanks in advance,

Haiko van der Schaaf



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



Re: autocomplete + ajaxformcomponentupdate - mouseselection not working after error

2014-04-04 Thread Martin Grigorov
Hi,

Try to debug it.
Open wicket-autocomplete.js in the browser dev tools and see what happens.

Martin Grigorov
Wicket Training and Consulting


On Fri, Apr 4, 2014 at 2:12 PM, ha...@dds.nl wrote:


 Hi wicketusers,

 I have an autocomplete textfield with an AjaxFormComponentUpdatingBehavior
 attached for the 'change' event.
 After an error on the input the update is handled in the onError method
 -- ( some pseudocode )

 autocompletefield.add(new AjaxFormComponentUpdatingBehavior(change) {

 .

 protected void onError(AjaxRequestTarget target,
 RuntimeException re) {
autocompletefield.add(new AttributeModifier(CLASS_ATTRIBUTE,
 AUTOCOMPLETE_INVALID_CLASS));
target.add(autocompletefield);
 }

 Here is the autocompletefield replaced by an updated version with a new
 class attribute.

 The problem is that a mouseselection of a listitem in the dropdown is not
 selected. A mouseselection just closes the autocomplete window. Selection
 with the keyboard works just fine.

 Any suggestions how to tackle this problem?

 Thanks in advance,

 Haiko van der Schaaf



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




Could you tell me the 6.14.0 wicket examples zip download url available today.

2014-04-04 Thread 003210
Hi,
I'v been told that for Wicket v1.2.4 examples, users can download by url 'http 
: //wicket.sourceforge.net/Download.html'.
But today the url 'http : //wicket.sourceforge.net/Download.html' is not 
available.
Could you tell me the 6.14.0 wicket examples zip download url available today.

thanks.




sunnybean
010-58963399-5244

Re: Could you tell me the 6.14.0 wicket examples zip download url available today.

2014-04-04 Thread Martin Grigorov
Hi,

http://central.maven.org/maven2/org/apache/wicket/wicket-examples/6.14.0/

Martin Grigorov
Wicket Training and Consulting


On Fri, Apr 4, 2014 at 4:38 AM, 003210 sunya...@raisecom.com wrote:

   Hi,
 I'v been told that for Wicket v1.2.4 examples, users can download by url
 'http : //wicket.sourceforge.net/Download.html'.
 But today the url 'http : //wicket.sourceforge.net/Download.html' is not
 available.
 Could you tell me the 6.14.0 wicket examples zip download
 url available today.

 thanks.

  --
  sunnybean
 010-58963399-5244



Wicket CDI 1.1

2014-04-04 Thread David Beer
Hi All

I am in the process of moving my application to JavaEE7 and CDI 1.1. Things
are going well all except for some CDI values. I have an @Stateless Session
bean used for my DAO which I then Inject into various classes. The issue I
have is that some of the classes don't get the reference Injected properly
and give a NPE. With wicket CDI I was able to call
CdiContainer.get().getNonContextualManager().inject(this); to Inject the
reference properly.

I know CDI 1.1 is different but I can't work out how to Inject the
Component with Wicket CDI 1.1?

Here is the code in my WicketApplication init():

 new CdiConfiguration().setPropagation(NONE).configure(this);

Thanks

David