Re: Submit form with ajax on enter

2010-05-20 Thread bluejack



cbchhaya wrote:
> 
> John,
> 
> Is the fix in 1.4.7?
> 
> 
> John Patterson wrote:
>> 
>> If I remember correctly, my patch was applied so you can now attach the
>> AjaxFormSubmitBehavior directly to the form and listen for onsubmit. 
>> This handles both enter and click.
>> 
> 
> 

It does not look like it is in as of 1.4.8; unless I'm doing something
wrong, the code is never exercised, and the enter key submits the form in
non-ajax fashion.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submit-form-with-ajax-on-enter-tp1843787p2225330.html
Sent from the Wicket - User mailing list archive at Nabble.com.


Re: Submit form with ajax on enter

2010-03-11 Thread cbchhaya

John,

Is the fix in 1.4.7?


John Patterson wrote:
> 
> 
> 
> MattyDE wrote:
>> 
>> Any other hints for this right now?
>> 
>> I want to submit an ajax-Form by hiting enter in Textfield, but i want
>> wicket to call the same Method as i defiend in "AjaxButton" ... any
>> ideas? 
>> 
>> Thanks a lot in Advance
>> 
> 
> If I remember correctly, my patch was applied so you can now attach the
> AjaxFormSubmitBehavior directly to the form and listen for onsubmit.  This
> handles both enter and click.
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p27869579.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: Submit form with ajax on enter

2010-02-04 Thread John Patterson



MattyDE wrote:
> 
> Any other hints for this right now?
> 
> I want to submit an ajax-Form by hiting enter in Textfield, but i want
> wicket to call the same Method as i defiend in "AjaxButton" ... any ideas? 
> 
> Thanks a lot in Advance
> 

If I remember correctly, my patch was applied so you can now attach the
AjaxFormSubmitBehavior directly to the form and listen for onsubmit.  This
handles both enter and click.

-- 
View this message in context: 
http://old.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p27452212.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: Submit form with ajax on enter

2010-02-04 Thread Daniel Stoch
I have the same problem today (what a coincidence :)).
This works ok for me in Firefox 3.5 and Opera 10, but does not work in
Chrome, Safari and IE.

PS. I'm using Wicket 1.4.4.

DS


On Thu, Feb 4, 2010 at 10:38 AM, MattyDE  wrote:
>
> Any other hints for this right now?
>
> I want to submit an ajax-Form by hiting enter in Textfield, but i want
> wicket to call the same Method as i defiend in "AjaxButton" ... any ideas?
>
> Thanks a lot in Advance
>

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



Re: Submit form with ajax on enter

2010-02-04 Thread MattyDE

Any other hints for this right now?

I want to submit an ajax-Form by hiting enter in Textfield, but i want
wicket to call the same Method as i defiend in "AjaxButton" ... any ideas? 

Thanks a lot in Advance





John Patterson wrote:
> 
> It is being used indirectly through AjaxButton.  Unfortunately
> AjaxFormSubmitBehavior cannot be used directly on the form to listen for
> "onsubmit"
> 
> 
> Emanuele Gesuato-2 wrote:
>> 
>> Why not using AjaxFormSubmitBehavior ?
>> 
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p27449961.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: Submit form with ajax on enter

2009-06-30 Thread John Patterson

It is being used indirectly through AjaxButton.  Unfortunately
AjaxFormSubmitBehavior cannot be used directly on the form to listen for
"onsubmit"


Emanuele Gesuato-2 wrote:
> 
> Why not using AjaxFormSubmitBehavior ?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p24282642.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: Submit form with ajax on enter

2009-06-30 Thread Emanuele Gesuato

Why not using AjaxFormSubmitBehavior ?

vineet semwal wrote:

you can use AjaxButton,AjaxFallbackButton,IndicatingAjaxButton.

regards,
Vineet Semwal

On Thu, Jun 25, 2009 at 9:47 AM, John Patterson wrote:


Hi, I have a single text box which I wan to be submitted by ajax when
either the enter key is pressed or a submit button clicked.  Is there an
easy way to submit the form or just the input when the return key is hit?

Thanks,

John

-
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: Submit form with ajax on enter

2009-06-26 Thread John Patterson

The first handler, which works for most cases, is missing the .click() method
-- 
View this message in context: 
http://www.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p24216221.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: Submit form with ajax on enter

2009-06-26 Thread John Patterson

Just to add some closure to this traumatic coding problem

I added a simple inline event handler like this


findTextField = new TextField("query")
{
@Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);

tag.put("onkeypress", "if (event.keyCode == 13) 
{
document.getElementById('" searchSubmitButton.getMarkupId() + "'); return
false;} 

// disable browser's autocomplete
tag.put("autocomplete", "off");
}
};

This worked a treat in my simplified test page but not in my actual
applications page.  After pulling my hair out for a good couple of hours I
isolated the problem to the fact that I had a Google Map (V3) on the page
which somehow interferes with event handling.  I assume its something to do
with their keyboard controls for moving the map.

After a bit more experimenting I found that I could not cancel the keypress
event as long as the Map was on the page so instead I diverted the form
submit event like this:


Form searchForm = new Form("search")
{
@Override
protected void onComponentTag(ComponentTag tag)
{
tag.put("onsubmit", "document.getElementById('" 
+
searchSubmitButton.getMarkupId() + "').click(); return false;");
super.onComponentTag(tag);
}
};

This works in IE6, Safari and Firefox with a map on the page.  
-- 
View this message in context: 
http://www.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p24216201.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: Submit form with ajax on enter

2009-06-25 Thread Peter Ertl
I had the same issue with IE in a ModalWindow containing a form which  
will immediately destroy the modal window :-(


Am 25.06.2009 um 08:34 schrieb John Patterson:



Actually, I have just found that hitting return in the text field  
fires the
AjaxButton in Safari but in IE6 the form is submitted and the url  
changed
i.e. not ajax.  I guess Safari finds the first submit button and  
invokes

submit() whereas IE seems to bypass the handler.

I could write some script to capture the enter key and... do  
something.


But is there an easy out of the box way?


John Patterson wrote:


Thanks, I can see now that the presence of the AjaxButton  
intercepts the

form submit and does exactly what I need.


vineet semwal wrote:


you can use AjaxButton,AjaxFallbackButton,IndicatingAjaxButton.







--
View this message in context: 
http://www.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p24197752.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



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



Re: Submit form with ajax on enter

2009-06-24 Thread John Patterson

Actually, I have just found that hitting return in the text field fires the
AjaxButton in Safari but in IE6 the form is submitted and the url changed
i.e. not ajax.  I guess Safari finds the first submit button and invokes
submit() whereas IE seems to bypass the handler.

I could write some script to capture the enter key and... do something.

But is there an easy out of the box way?


John Patterson wrote:
> 
> Thanks, I can see now that the presence of the AjaxButton intercepts the
> form submit and does exactly what I need.
> 
> 
> vineet semwal wrote:
>> 
>> you can use AjaxButton,AjaxFallbackButton,IndicatingAjaxButton.
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p24197752.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: Submit form with ajax on enter

2009-06-24 Thread John Patterson

Thanks, I can see now that the presence of the AjaxButton intercepts the form
submit and does exactly what I need.


vineet semwal wrote:
> 
> you can use AjaxButton,AjaxFallbackButton,IndicatingAjaxButton.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Submit-form-with-ajax-on-enter-tp24196732p24197546.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: Submit form with ajax on enter

2009-06-24 Thread vineet semwal
you can use AjaxButton,AjaxFallbackButton,IndicatingAjaxButton.

regards,
Vineet Semwal

On Thu, Jun 25, 2009 at 9:47 AM, John Patterson wrote:

> Hi, I have a single text box which I wan to be submitted by ajax when
> either the enter key is pressed or a submit button clicked.  Is there an
> easy way to submit the form or just the input when the return key is hit?
>
> Thanks,
>
> John
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Submit form with ajax on enter

2009-06-24 Thread John Patterson
Hi, I have a single text box which I wan to be submitted by ajax when  
either the enter key is pressed or a submit button clicked.  Is there  
an easy way to submit the form or just the input when the return key  
is hit?


Thanks,

John

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