You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Shelli Orton <Sh...@sjrb.ca> on 2010/10/04 22:40:22 UTC
Confirmation Dialog Not Displayed For Button
Hi,
I have the following code to create a
org.apache.wicket.markup.html.form.Button:
Button delete = new Button("delete")
{
public void onSubmit()
{
// Delete the selected record
}
};
delete.add(new SimpleAttributeModifier(
"onclick", "return confirm('Delete?');"));
form.add(delete);
On my html page I have this:
<input wicket:id="delete" type="submit" value="Delete" />
When I run the application and click on the delete button, the dialog
box is not displayed and the onSubmit method is executed. I checked the
page source and it looks like this:
<input wicket:id="delete" type="submit" value="Delete" name="delete"
id="delete4" onclick="return confirm('Delete?');"/>
What am I doing wrong?
Thanks!
Shelli
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Confirmation Dialog Not Displayed For Button
Posted by Shelli Orton <Sh...@sjrb.ca>.
I am using FF 3.6.10 and there were no javascript errors. However,
adding the if statement seemed to make the difference as it's now
displaying.
Thanks!
-----Original Message-----
From: Mathias Nilsson [mailto:wicket.programmer@gmail.com]
Sent: Monday, October 04, 2010 2:51 PM
To: users@wicket.apache.org
Subject: Re: Confirmation Dialog Not Displayed For Button
I ran this in IE7, Firefox and Google Chrome and it worked fine. make
sure
you don't have a javascript error in the page and maybe add
delete.add(new SimpleAttributeModifier( "onclick", "if
(!confirm('Delete?')
){ return false; }"));
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Confirmation-Dialog-Not-Displ
ayed-For-Button-tp2955022p2955033.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Confirmation Dialog Not Displayed For Button
Posted by Mathias Nilsson <wi...@gmail.com>.
I ran this in IE7, Firefox and Google Chrome and it worked fine. make sure
you don't have a javascript error in the page and maybe add
delete.add(new SimpleAttributeModifier( "onclick", "if (!confirm('Delete?')
){ return false; }"));
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Confirmation-Dialog-Not-Displayed-For-Button-tp2955022p2955033.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org