Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key

2008-10-31 Thread Nino Saturnino Martinez Vazquez Wael
net/"; lang="EN-US">

 
 
   
 
   
   Password: 
 
   
   
 
   
 
 
# Cancel
 
   
 
 



-

Here is my AjaxButton which I add to my Form object.

 add(new AjaxButton("okButton", this) {
   @Override
   protected void onSubmit(AjaxRequestTarget target, Form form)
{
 if(form.get("password") != null &&
(PasswordTextField)form.get("password") != null) {
   String userEnteredPassword =
((PasswordTextField)form.get("password")).getInput();
   if(userEnteredPassword != null &&
!userEnteredPassword.equals("") && validPassword(userEnteredPassword))
{
 //Delete successful; closing window
 window.close(target);
 return;
   }
 }
 error("Invalid password");
   }
-

Thanks.

--
View this message in context:
http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-----------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  

--
View this message in context:
http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20236367.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key

2008-10-30 Thread mallet
rror message on my Panel's
>>>>> FeedbackPanel
>>>>> in
>>>>> the event of en error; otherwise it closes the ModalWindow and
>>>>> refreshes
>>>>> the
>>>>> calling page.
>>>>>
>>>>> This works flawlessly when I use the mouse button to click my
>>>>> AjaxButton.
>>>>> It also works in FireFox3 when I use the enter button.  But in IE7
>>>>> when I
>>>>> use the enter button instead of the mouse, it gives me a 404 error in
>>>>> my
>>>>> browser and the modal window disappears without running the onSubmit
>>>>> function.
>>>>>
>>>>> Any suggestions on how to make this work for IE7?
>>>>>
>>>>> I would like to use a ModalWindow if at all possible instead of
>>>>> popping
>>>>> up
>>>>> another page.
>>>>>
>>>>> Here is my HTML:
>>>>>
>>>>> http://wicket.sourceforge.net/"; lang="EN-US">
>>>>> 
>>>>>  
>>>>>  >>>> align="center">
>>>>>
>>>>>  
>>>>>
>>>>>Password: >>>> name="Password">
>>>>>  
>>>>>
>>>>>
>>>>>  
>>>>>
>>>>>  
>>>>>  
>>>>> # Cancel
>>>>>  
>>>>>    
>>>>>  
>>>>>  
>>>>> 
>>>>> 
>>>>>
>>>>> -
>>>>>
>>>>> Here is my AjaxButton which I add to my Form object.
>>>>>
>>>>>  add(new AjaxButton("okButton", this) {
>>>>>@Override
>>>>>protected void onSubmit(AjaxRequestTarget target, Form form)
>>>>> {
>>>>>  if(form.get("password") != null &&
>>>>> (PasswordTextField)form.get("password") != null) {
>>>>>String userEnteredPassword =
>>>>> ((PasswordTextField)form.get("password")).getInput();
>>>>>if(userEnteredPassword != null &&
>>>>> !userEnteredPassword.equals("") && validPassword(userEnteredPassword))
>>>>> {
>>>>>  //Delete successful; closing window
>>>>>  window.close(target);
>>>>>  return;
>>>>>}
>>>>>  }
>>>>>  error("Invalid password");
>>>>>}
>>>>> -
>>>>>
>>>>> Thanks.
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html
>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20236367.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20252256.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key

2008-10-29 Thread mallet

I tried as you suggested, but it gives me the 404 error in IE again.  The
browser bar in the 404 window has these parameters in it, after I typed
asdfasdf and hit enter:
?pnList%3A0%3Aorders%3A0%3ApasswordModal%3Acontent%3Aform%3Apassword=asdfasdf

I can put an alert('hi') in place of
document.getelementbyid('okButton').onclick(), and it alerts me.  Or I can
simply do return false; and the enter button will be deactivated.  But for
some reason I am not able to access the okButton's onclick function like
this... or maybe I am accessing it, but the problem is in there.

I'll try some other things and get back if I find a solution.


igor.vaynberg wrote:
> 
> if (wicketKeyCode(event) == 13) {
>   document.getelementbyid('myajaxbuttonsid').onclick(); }
> 
> -igor
> 
> On Wed, Oct 29, 2008 at 2:34 PM, mallet <[EMAIL PROTECTED]> wrote:
>>
>> Igor,
>>
>> Thanks for your reply.  Here's what I did:
>>
>>  PasswordTextField passwordTextField = new
>> PasswordTextField("password", new Model());
>>
>>passwordTextField.add(new
>> AjaxFormComponentUpdatingBehavior("onkeydown") {
>>@Override
>>public void onComponentTag(ComponentTag tag)
>>{
>>super.onComponentTag(tag);
>>tag.put("onkeydown", "if (wicketKeyCode(event) == 13)
>> {
>> return false;}; ");
>>
>>}
>>
>>});
>>
>> However, the problem I have now is that the enter key no longer submits
>> the
>> form through my AjaxButton's onSubmit function.  It simply disables the
>> enter key from doing anything.  This is better than before, but the users
>> of
>> this want to use the enter key to submit the form rather than the mouse
>> click.
>>
>> I wonder if there is any way I can have it propagate the enter key to
>> call
>> the same function as when I press the AjaxButton with my mouse?
>>
>>
>> igor.vaynberg wrote:
>>>
>>> easiest thing is to simply disable the enter key on the textfield by
>>> override onkeydown
>>>
>>> -igor
>>>
>>> On Wed, Oct 29, 2008 at 1:04 PM, mallet <[EMAIL PROTECTED]> wrote:
>>>>
>>>> I have a ModalWindow containing a class extending Panel.  On the Panel
>>>> I
>>>> have
>>>> a class extending Form.
>>>> The Form contains a custom AjaxButton which overrides protected void
>>>> onSubmit(AjaxRequestTarget target, Form form).
>>>>
>>>> When I click this button it retrieves text from a PasswordField and
>>>> validates it.  It displays an error message on my Panel's FeedbackPanel
>>>> in
>>>> the event of en error; otherwise it closes the ModalWindow and
>>>> refreshes
>>>> the
>>>> calling page.
>>>>
>>>> This works flawlessly when I use the mouse button to click my
>>>> AjaxButton.
>>>> It also works in FireFox3 when I use the enter button.  But in IE7 when
>>>> I
>>>> use the enter button instead of the mouse, it gives me a 404 error in
>>>> my
>>>> browser and the modal window disappears without running the onSubmit
>>>> function.
>>>>
>>>> Any suggestions on how to make this work for IE7?
>>>>
>>>> I would like to use a ModalWindow if at all possible instead of popping
>>>> up
>>>> another page.
>>>>
>>>> Here is my HTML:
>>>>
>>>> http://wicket.sourceforge.net/"; lang="EN-US">
>>>> 
>>>>  
>>>>  >>> align="center">
>>>>
>>>>  
>>>>
>>>>Password: >>> name="Password">
>>>>  
>>>>
>>>>
>>>>  
>>>>    
>>>>      
>>>>  
>>>> # Cancel
>>>>  
>>>>
>>>>  
>>>>  
>>>> 
>>>> 
>>>>
>>>> -
>>>>
>>>> Here is my AjaxButton which I add to my Form object.
>>>>
>>>>  add(new AjaxButton("okButton", this) {
>>>>@Override
>>>>protected void onSubmit(AjaxRequestTarget target, Form form)
>>>> {
>>>>  if(form.get("

Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key

2008-10-29 Thread Igor Vaynberg
if (wicketKeyCode(event) == 13) {
  document.getelementbyid('myajaxbuttonsid').onclick(); }

-igor

On Wed, Oct 29, 2008 at 2:34 PM, mallet <[EMAIL PROTECTED]> wrote:
>
> Igor,
>
> Thanks for your reply.  Here's what I did:
>
>  PasswordTextField passwordTextField = new
> PasswordTextField("password", new Model());
>
>passwordTextField.add(new
> AjaxFormComponentUpdatingBehavior("onkeydown") {
>@Override
>public void onComponentTag(ComponentTag tag)
>{
>super.onComponentTag(tag);
>tag.put("onkeydown", "if (wicketKeyCode(event) == 13) {
> return false;}; ");
>
>}
>
>});
>
> However, the problem I have now is that the enter key no longer submits the
> form through my AjaxButton's onSubmit function.  It simply disables the
> enter key from doing anything.  This is better than before, but the users of
> this want to use the enter key to submit the form rather than the mouse
> click.
>
> I wonder if there is any way I can have it propagate the enter key to call
> the same function as when I press the AjaxButton with my mouse?
>
>
> igor.vaynberg wrote:
>>
>> easiest thing is to simply disable the enter key on the textfield by
>> override onkeydown
>>
>> -igor
>>
>> On Wed, Oct 29, 2008 at 1:04 PM, mallet <[EMAIL PROTECTED]> wrote:
>>>
>>> I have a ModalWindow containing a class extending Panel.  On the Panel I
>>> have
>>> a class extending Form.
>>> The Form contains a custom AjaxButton which overrides protected void
>>> onSubmit(AjaxRequestTarget target, Form form).
>>>
>>> When I click this button it retrieves text from a PasswordField and
>>> validates it.  It displays an error message on my Panel's FeedbackPanel
>>> in
>>> the event of en error; otherwise it closes the ModalWindow and refreshes
>>> the
>>> calling page.
>>>
>>> This works flawlessly when I use the mouse button to click my AjaxButton.
>>> It also works in FireFox3 when I use the enter button.  But in IE7 when I
>>> use the enter button instead of the mouse, it gives me a 404 error in my
>>> browser and the modal window disappears without running the onSubmit
>>> function.
>>>
>>> Any suggestions on how to make this work for IE7?
>>>
>>> I would like to use a ModalWindow if at all possible instead of popping
>>> up
>>> another page.
>>>
>>> Here is my HTML:
>>>
>>> http://wicket.sourceforge.net/"; lang="EN-US">
>>> 
>>>  
>>>  >> align="center">
>>>
>>>  
>>>
>>>Password: >> name="Password">
>>>  
>>>
>>>
>>>  
>>>
>>>  
>>>  
>>> # Cancel
>>>  
>>>
>>>  
>>>  
>>> 
>>> 
>>>
>>> -
>>>
>>> Here is my AjaxButton which I add to my Form object.
>>>
>>>  add(new AjaxButton("okButton", this) {
>>>    @Override
>>>protected void onSubmit(AjaxRequestTarget target, Form form) {
>>>  if(form.get("password") != null &&
>>> (PasswordTextField)form.get("password") != null) {
>>>String userEnteredPassword =
>>> ((PasswordTextField)form.get("password")).getInput();
>>>if(userEnteredPassword != null &&
>>> !userEnteredPassword.equals("") && validPassword(userEnteredPassword)) {
>>>      //Delete successful; closing window
>>>  window.close(target);
>>>  return;
>>>}
>>>  }
>>>  error("Invalid password");
>>>}
>>> -
>>>
>>> Thanks.
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20236367.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key

2008-10-29 Thread mallet

Igor,

Thanks for your reply.  Here's what I did:

  PasswordTextField passwordTextField = new
PasswordTextField("password", new Model());

passwordTextField.add(new
AjaxFormComponentUpdatingBehavior("onkeydown") {
@Override
public void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
tag.put("onkeydown", "if (wicketKeyCode(event) == 13) {
return false;}; ");

}

});

However, the problem I have now is that the enter key no longer submits the
form through my AjaxButton's onSubmit function.  It simply disables the
enter key from doing anything.  This is better than before, but the users of
this want to use the enter key to submit the form rather than the mouse
click.

I wonder if there is any way I can have it propagate the enter key to call
the same function as when I press the AjaxButton with my mouse?


igor.vaynberg wrote:
> 
> easiest thing is to simply disable the enter key on the textfield by
> override onkeydown
> 
> -igor
> 
> On Wed, Oct 29, 2008 at 1:04 PM, mallet <[EMAIL PROTECTED]> wrote:
>>
>> I have a ModalWindow containing a class extending Panel.  On the Panel I
>> have
>> a class extending Form.
>> The Form contains a custom AjaxButton which overrides protected void
>> onSubmit(AjaxRequestTarget target, Form form).
>>
>> When I click this button it retrieves text from a PasswordField and
>> validates it.  It displays an error message on my Panel's FeedbackPanel
>> in
>> the event of en error; otherwise it closes the ModalWindow and refreshes
>> the
>> calling page.
>>
>> This works flawlessly when I use the mouse button to click my AjaxButton.
>> It also works in FireFox3 when I use the enter button.  But in IE7 when I
>> use the enter button instead of the mouse, it gives me a 404 error in my
>> browser and the modal window disappears without running the onSubmit
>> function.
>>
>> Any suggestions on how to make this work for IE7?
>>
>> I would like to use a ModalWindow if at all possible instead of popping
>> up
>> another page.
>>
>> Here is my HTML:
>>
>> http://wicket.sourceforge.net/"; lang="EN-US">
>> 
>>  
>>  > align="center">
>>
>>  
>>
>>Password: > name="Password">
>>  
>>
>>
>>  
>>
>>  
>>  
>> # Cancel
>>  
>>
>>  
>>  
>> 
>> 
>>
>> -
>>
>> Here is my AjaxButton which I add to my Form object.
>>
>>  add(new AjaxButton("okButton", this) {
>>@Override
>>protected void onSubmit(AjaxRequestTarget target, Form form) {
>>  if(form.get("password") != null &&
>> (PasswordTextField)form.get("password") != null) {
>>    String userEnteredPassword =
>> ((PasswordTextField)form.get("password")).getInput();
>>if(userEnteredPassword != null &&
>> !userEnteredPassword.equals("") && validPassword(userEnteredPassword)) {
>>  //Delete successful; closing window
>>  window.close(target);
>>  return;
>>}
>>  }
>>  error("Invalid password");
>>}
>> -
>>
>> Thanks.
>>
>> --
>> View this message in context:
>> http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20236367.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key

2008-10-29 Thread Igor Vaynberg
easiest thing is to simply disable the enter key on the textfield by
override onkeydown

-igor

On Wed, Oct 29, 2008 at 1:04 PM, mallet <[EMAIL PROTECTED]> wrote:
>
> I have a ModalWindow containing a class extending Panel.  On the Panel I have
> a class extending Form.
> The Form contains a custom AjaxButton which overrides protected void
> onSubmit(AjaxRequestTarget target, Form form).
>
> When I click this button it retrieves text from a PasswordField and
> validates it.  It displays an error message on my Panel's FeedbackPanel in
> the event of en error; otherwise it closes the ModalWindow and refreshes the
> calling page.
>
> This works flawlessly when I use the mouse button to click my AjaxButton.
> It also works in FireFox3 when I use the enter button.  But in IE7 when I
> use the enter button instead of the mouse, it gives me a 404 error in my
> browser and the modal window disappears without running the onSubmit
> function.
>
> Any suggestions on how to make this work for IE7?
>
> I would like to use a ModalWindow if at all possible instead of popping up
> another page.
>
> Here is my HTML:
>
> http://wicket.sourceforge.net/"; lang="EN-US">
> 
>  
>   align="center">
>
>  
>
>Password:  name="Password">
>  
>
>
>  
>
>  
>  
> # Cancel
>  
>
>  
>  
> 
> 
>
> -
>
> Here is my AjaxButton which I add to my Form object.
>
>  add(new AjaxButton("okButton", this) {
>@Override
>protected void onSubmit(AjaxRequestTarget target, Form form) {
>  if(form.get("password") != null &&
> (PasswordTextField)form.get("password") != null) {
>String userEnteredPassword =
> ((PasswordTextField)form.get("password")).getInput();
>if(userEnteredPassword != null &&
> !userEnteredPassword.equals("") && validPassword(userEnteredPassword)) {
>      //Delete successful; closing window
>  window.close(target);
>  return;
>}
>  }
>  error("Invalid password");
>}
> -
>
> Thanks.
>
> --
> View this message in context: 
> http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key

2008-10-29 Thread mallet

FYI, I did try some of the suggestions in here but to no avail:
http://www.nabble.com/Form-Enter-Key-Problem-td14408121.html

Also I have investigated using some custom JavaScript manipulate IE, but I
would like to avoid a messy solution like that if possible.
-- 
View this message in context: 
http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234941.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



IE7 ignores AjaxButton onSubmit when I use the keyboard enter key

2008-10-29 Thread mallet

I have a ModalWindow containing a class extending Panel.  On the Panel I have
a class extending Form.
The Form contains a custom AjaxButton which overrides protected void
onSubmit(AjaxRequestTarget target, Form form).

When I click this button it retrieves text from a PasswordField and
validates it.  It displays an error message on my Panel's FeedbackPanel in
the event of en error; otherwise it closes the ModalWindow and refreshes the
calling page.

This works flawlessly when I use the mouse button to click my AjaxButton. 
It also works in FireFox3 when I use the enter button.  But in IE7 when I
use the enter button instead of the mouse, it gives me a 404 error in my
browser and the modal window disappears without running the onSubmit
function.

Any suggestions on how to make this work for IE7?

I would like to use a ModalWindow if at all possible instead of popping up
another page.

Here is my HTML:

http://wicket.sourceforge.net/"; lang="EN-US">

  
  

  

Password: 
  


  

  
  
 # Cancel 
  

  
  



-

Here is my AjaxButton which I add to my Form object.

  add(new AjaxButton("okButton", this) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
  if(form.get("password") != null &&
(PasswordTextField)form.get("password") != null) {
String userEnteredPassword =
((PasswordTextField)form.get("password")).getInput();
if(userEnteredPassword != null &&
!userEnteredPassword.equals("") && validPassword(userEnteredPassword)) {
  //Delete successful; closing window
  window.close(target);  
  return;
}
  }
  error("Invalid password");
    }
-----

Thanks.

-- 
View this message in context: 
http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]