You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Maris Orbidans <ma...@ingg.com> on 2010/07/01 18:21:52 UTC
javascript message after ajax request
Wicket experts,
I have a form with Ajax submit button. Upon completing ajax request
I want to show javascript popup with a message from server.
How to do it ?
Maris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to clear a TextField input?
Posted by David Chang <da...@yahoo.com>.
igor, thank you for the tip. that works.
best.
--- On Thu, 7/1/10, Igor Vaynberg <ig...@gmail.com> wrote:
> From: Igor Vaynberg <ig...@gmail.com>
> Subject: Re: How to clear a TextField input?
> To: users@wicket.apache.org
> Date: Thursday, July 1, 2010, 6:32 PM
> set the model object to null as
> well.
>
> -igor
>
> On Thu, Jul 1, 2010 at 3:25 PM, David Chang <da...@yahoo.com>
> wrote:
> > I have a form where it has two elements: AjaxCheckbox
> and TextField. When the checkbox is un-checked, the
> TextField in browser should look blank. Here is the code I
> have:
> >
> > final TextField input = new TextField("myinput") {
> > void onBeforeRender() {
> > super.onBeforeRender();
> > if ("certain way to get model and check is myproperty
> and if it is not true")
> > this.clearInput();
> > }
> > }
> > };
> > AjaxCheckBox box = new AjaxCheckBox("mycheckbox",
> > new PropertyModel(model, "myproperty")) {
> > @Override
> > protected void onUpdate(AjaxRequestTarget target) {
> > if (target != null) {
> > target.addComponent(input);
> > }
> > }
> > };
> >
> > However, when I uncheck the checkbox,
> this.clearInput() in TextField is called, but the in the
> browser, the text field value in the browser is always
> there.
> >
> > Spent sometime and unable to find a way to solve this
> issue. In javascript, this task is so easy. I must have
> missed something.
> >
> > Can somebody show me how to clear the TextField value
> in the browser?
> >
> > Thanks!
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to clear a TextField input?
Posted by Igor Vaynberg <ig...@gmail.com>.
set the model object to null as well.
-igor
On Thu, Jul 1, 2010 at 3:25 PM, David Chang <da...@yahoo.com> wrote:
> I have a form where it has two elements: AjaxCheckbox and TextField. When the checkbox is un-checked, the TextField in browser should look blank. Here is the code I have:
>
> final TextField input = new TextField("myinput") {
> void onBeforeRender() {
> super.onBeforeRender();
> if ("certain way to get model and check is myproperty and if it is not true")
> this.clearInput();
> }
> }
> };
> AjaxCheckBox box = new AjaxCheckBox("mycheckbox",
> new PropertyModel(model, "myproperty")) {
> @Override
> protected void onUpdate(AjaxRequestTarget target) {
> if (target != null) {
> target.addComponent(input);
> }
> }
> };
>
> However, when I uncheck the checkbox, this.clearInput() in TextField is called, but the in the browser, the text field value in the browser is always there.
>
> Spent sometime and unable to find a way to solve this issue. In javascript, this task is so easy. I must have missed something.
>
> Can somebody show me how to clear the TextField value in the browser?
>
> Thanks!
>
>
>
>
> ---------------------------------------------------------------------
> 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: javascript message after ajax request
Posted by Maris Orbidans <ma...@ingg.com>.
Awesome, thanks.
> -----Original Message-----
> From: Pedro Santos [mailto:pedrosans@gmail.com]
> Sent: 01 July 2010 17:25
> To: users@wicket.apache.org
> Subject: Re: javascript message after ajax request
>
> you can use the appendJavascript method from the AjaxRequestTarget
like:
> target.appendJavascript ("alert('some message')");
>
> On Thu, Jul 1, 2010 at 1:21 PM, Maris Orbidans
> <ma...@ingg.com>wrote:
>
> >
> > Wicket experts,
> >
> > I have a form with Ajax submit button. Upon completing ajax request
> > I want to show javascript popup with a message from server.
> > How to do it ?
> >
> >
> > Maris
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
>
> _____________________________________________________________________
> This e-mail has been scanned for viruses by MessageLabs.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: javascript message after ajax request
Posted by Pedro Santos <pe...@gmail.com>.
you can use the appendJavascript method from the AjaxRequestTarget like:
target.appendJavascript ("alert('some message')");
On Thu, Jul 1, 2010 at 1:21 PM, Maris Orbidans <ma...@ingg.com>wrote:
>
> Wicket experts,
>
> I have a form with Ajax submit button. Upon completing ajax request
> I want to show javascript popup with a message from server.
> How to do it ?
>
>
> Maris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Pedro Henrique Oliveira dos Santos
Re: javascript message after ajax request
Posted by Alex Objelean <al...@gmail.com>.
The best approach is to use AjaxCallDecorator:
new AjaxLink<Void>(id) {
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence decorateOnSuccessScript(CharSequence script) {
return "alert('done');";
}
};
}
Alex
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-show-hide-individual-column-of-a-DefaultDataTable-using-Ajax-tp2275208p2275440.html
Sent from the Wicket - User 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
Re: javascript message after ajax request
Posted by Martin Grigorov <mc...@e-card.bg>.
AjaxButton submitButton = new AjaxButton("wid", form) {
public void onSubmit(AjaxRequestTarget target) {
// your logic here
targer.appendJavascript("showPopup(document.getElementById('myPopupId'))");
}
}
On Thu, 2010-07-01 at 17:21 +0100, Maris Orbidans wrote:
> Wicket experts,
>
> I have a form with Ajax submit button. Upon completing ajax request
> I want to show javascript popup with a message from server.
> How to do it ?
>
>
> Maris
>
> ---------------------------------------------------------------------
> 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
How to clear a TextField input?
Posted by David Chang <da...@yahoo.com>.
I have a form where it has two elements: AjaxCheckbox and TextField. When the checkbox is un-checked, the TextField in browser should look blank. Here is the code I have:
final TextField input = new TextField("myinput") {
void onBeforeRender() {
super.onBeforeRender();
if ("certain way to get model and check is myproperty and if it is not true")
this.clearInput();
}
}
};
AjaxCheckBox box = new AjaxCheckBox("mycheckbox",
new PropertyModel(model, "myproperty")) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (target != null) {
target.addComponent(input);
}
}
};
However, when I uncheck the checkbox, this.clearInput() in TextField is called, but the in the browser, the text field value in the browser is always there.
Spent sometime and unable to find a way to solve this issue. In javascript, this task is so easy. I must have missed something.
Can somebody show me how to clear the TextField value in the browser?
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org