You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gwyn Evans <gw...@gmail.com> on 2007/10/02 12:18:36 UTC

Re: Form behaviour...

Thanks for that, Matej - in the tend I've gone for separate forms, as
that fits in with some other changes I was doing.


On a similar note, are there any good ways of using AJAX to get the
value of a text field (currently in a form on it's own) back to the
server when the user hits return?

It's currently working via with the standard form submit, and I'm
using textField.onModelChanged(), but I've not managed to find the
right combination of events to go with AjaxFormSubmitBehaviour and/or
AjaxFormComponentUpdatingBehavior to do what I need!  Either that, or
the return's triggering a standard form submit anyway...

I suppose I could take it out of the form then try & write a component
to listen for keyUp's in JS then send it on the Return, but as it
doesn't seem that esoteric a requirement, I suspect I'm missing
something?

/Gwyn


On Thursday, September 27, 2007, 7:32:31 PM, Matej <ma...@gmail.com> wrote:

> I don't think there's an easy solution for what you want. You can try
> putting in two buttons, set one button as form default and hide it
> using css. That one should be submitted when you press enter on the
> text field.

> -Matej

> On 9/27/07, Gwyn Evans <gw...@gmail.com> wrote:
>> Hi,
>>
>> I've got a form, on which I have, among other things, a TextField and an
>> AjaxFallbackButton.
>>
>> The problem I have is that when then user enters a string into the
>> text field and presses return, both the TextField.onModelChanged() and
>> the AjaxFallbackButton.onSubmit() fire, but I'd like to avoid the
>> latter and only have that happen when it's explicitly clicked.
>>
>> Is there a way of doing that, or do I just need to split them into two
>> forms? If this a case for nested forms, in which case, which should be
>> inside the other & why?
>>
>> --
>> Best regards,
>>  Gwyn                          mailto:gwyn.evans@gmail.com
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>



/Gwyn


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


Re: Form behaviour...

Posted by Eelco Hillenius <ee...@gmail.com>.
> On a similar note, are there any good ways of using AJAX to get the
> value of a text field (currently in a form on it's own) back to the
> server when the user hits return?
>
> It's currently working via with the standard form submit, and I'm
> using textField.onModelChanged(), but I've not managed to find the
> right combination of events to go with AjaxFormSubmitBehaviour and/or
> AjaxFormComponentUpdatingBehavior to do what I need!  Either that, or
> the return's triggering a standard form submit anyway...
>
> I suppose I could take it out of the form then try & write a component
> to listen for keyUp's in JS then send it on the Return, but as it
> doesn't seem that esoteric a requirement, I suspect I'm missing
> something?

That sounds like the way to do it. Or find another way to eat up the
enter key press so that it doesn't trigger a form submit.

Eelco

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