You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Anna Simbirtsev <as...@gmail.com> on 2010/07/01 03:22:48 UTC
Rerender modal window fields without ajaxtargetrequest
Hi,
AjaxSubmitLink removeLink = new AjaxSubmitLink("removeLink") {
@Override
public void onSubmit(AjaxTargetRequest target) {
MyPanel.this.replaceWith(new ConfirmDeletePanel(
MyPanel.this.getId(), "are you sure") {
@Override
protected void onCancel() {
this.replaceWith(MyPanel.this);
}
@Override
protected void onConfirm() {
// do something you want confirmed beforehand
// .... then
this.replaceWith(MyPanel.this);
}
});
}
};
In onConfirm function of ConfirmDeletePanel, how can I rerender some fields
in the MyPanel.this after it is replaced back if i don't have
AjaxTargetRequest?
I mean onConfirm changes the values that are displayed on MyPanel and I want
to refresh them.
Thanks
Anna
Re: Rerender modal window fields without ajaxtargetrequest
Posted by Anna Simbirtsev <as...@gmail.com>.
Thank you, I'll try it.
On Thu, Jul 1, 2010 at 2:41 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:
> Anna,
>
> You mean how to access AjaxRequestTarget? Try AjaxRequestTarget.get():
> I think it can be accessed as a thread local.
>
> Ernesto
>
> On Thu, Jul 1, 2010 at 3:22 AM, Anna Simbirtsev <as...@gmail.com>
> wrote:
> > Hi,
> >
> > AjaxSubmitLink removeLink = new AjaxSubmitLink("removeLink") {
> > @Override
> > public void onSubmit(AjaxTargetRequest target) {
> >
> > MyPanel.this.replaceWith(new ConfirmDeletePanel(
> > MyPanel.this.getId(), "are you sure") {
> >
> > @Override
> > protected void onCancel() {
> > this.replaceWith(MyPanel.this);
> > }
> >
> > @Override
> > protected void onConfirm() {
> > // do something you want confirmed beforehand
> > // .... then
> > this.replaceWith(MyPanel.this);
> > }
> > });
> > }
> >
> > };
> > In onConfirm function of ConfirmDeletePanel, how can I rerender some
> fields
> > in the MyPanel.this after it is replaced back if i don't have
> > AjaxTargetRequest?
> > I mean onConfirm changes the values that are displayed on MyPanel and I
> want
> > to refresh them.
> >
> > Thanks
> > Anna
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Anna Simbirtsev
(416) 729-7331
Re: Rerender modal window fields without ajaxtargetrequest
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Then that probably means you are not making an AJAX round trip...
public static AjaxRequestTarget get()
{
final RequestCycle requestCycle = RequestCycle.get();
if (requestCycle != null)
{
if (requestCycle.getRequestTarget() instanceof AjaxRequestTarget)
{
return (AjaxRequestTarget)requestCycle.getRequestTarget();
}
}
return null;
}
Ernesto
On Fri, Jul 2, 2010 at 4:13 PM, Anna Simbirtsev <as...@gmail.com> wrote:
> I get a null pointer exception, I think the AjaxRequestTarget.get() returns
> null.
>
> On Thu, Jul 1, 2010 at 2:41 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
>> Anna,
>>
>> You mean how to access AjaxRequestTarget? Try AjaxRequestTarget.get():
>> I think it can be accessed as a thread local.
>>
>> Ernesto
>>
>> On Thu, Jul 1, 2010 at 3:22 AM, Anna Simbirtsev <as...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > AjaxSubmitLink removeLink = new AjaxSubmitLink("removeLink") {
>> > @Override
>> > public void onSubmit(AjaxTargetRequest target) {
>> >
>> > MyPanel.this.replaceWith(new ConfirmDeletePanel(
>> > MyPanel.this.getId(), "are you sure") {
>> >
>> > @Override
>> > protected void onCancel() {
>> > this.replaceWith(MyPanel.this);
>> > }
>> >
>> > @Override
>> > protected void onConfirm() {
>> > // do something you want confirmed beforehand
>> > // .... then
>> > this.replaceWith(MyPanel.this);
>> > }
>> > });
>> > }
>> >
>> > };
>> > In onConfirm function of ConfirmDeletePanel, how can I rerender some
>> fields
>> > in the MyPanel.this after it is replaced back if i don't have
>> > AjaxTargetRequest?
>> > I mean onConfirm changes the values that are displayed on MyPanel and I
>> want
>> > to refresh them.
>> >
>> > Thanks
>> > Anna
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Anna Simbirtsev
> (416) 729-7331
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Rerender modal window fields without ajaxtargetrequest
Posted by Anna Simbirtsev <as...@gmail.com>.
I get a null pointer exception, I think the AjaxRequestTarget.get() returns
null.
On Thu, Jul 1, 2010 at 2:41 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:
> Anna,
>
> You mean how to access AjaxRequestTarget? Try AjaxRequestTarget.get():
> I think it can be accessed as a thread local.
>
> Ernesto
>
> On Thu, Jul 1, 2010 at 3:22 AM, Anna Simbirtsev <as...@gmail.com>
> wrote:
> > Hi,
> >
> > AjaxSubmitLink removeLink = new AjaxSubmitLink("removeLink") {
> > @Override
> > public void onSubmit(AjaxTargetRequest target) {
> >
> > MyPanel.this.replaceWith(new ConfirmDeletePanel(
> > MyPanel.this.getId(), "are you sure") {
> >
> > @Override
> > protected void onCancel() {
> > this.replaceWith(MyPanel.this);
> > }
> >
> > @Override
> > protected void onConfirm() {
> > // do something you want confirmed beforehand
> > // .... then
> > this.replaceWith(MyPanel.this);
> > }
> > });
> > }
> >
> > };
> > In onConfirm function of ConfirmDeletePanel, how can I rerender some
> fields
> > in the MyPanel.this after it is replaced back if i don't have
> > AjaxTargetRequest?
> > I mean onConfirm changes the values that are displayed on MyPanel and I
> want
> > to refresh them.
> >
> > Thanks
> > Anna
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Anna Simbirtsev
(416) 729-7331
Re: Rerender modal window fields without ajaxtargetrequest
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Anna,
You mean how to access AjaxRequestTarget? Try AjaxRequestTarget.get():
I think it can be accessed as a thread local.
Ernesto
On Thu, Jul 1, 2010 at 3:22 AM, Anna Simbirtsev <as...@gmail.com> wrote:
> Hi,
>
> AjaxSubmitLink removeLink = new AjaxSubmitLink("removeLink") {
> @Override
> public void onSubmit(AjaxTargetRequest target) {
>
> MyPanel.this.replaceWith(new ConfirmDeletePanel(
> MyPanel.this.getId(), "are you sure") {
>
> @Override
> protected void onCancel() {
> this.replaceWith(MyPanel.this);
> }
>
> @Override
> protected void onConfirm() {
> // do something you want confirmed beforehand
> // .... then
> this.replaceWith(MyPanel.this);
> }
> });
> }
>
> };
> In onConfirm function of ConfirmDeletePanel, how can I rerender some fields
> in the MyPanel.this after it is replaced back if i don't have
> AjaxTargetRequest?
> I mean onConfirm changes the values that are displayed on MyPanel and I want
> to refresh them.
>
> Thanks
> Anna
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org