Hi,

I think the idea is more to replace
wicketSubmitFormById('form','" +formAjaxBehavior.getCallbackUrl() +"',
null, null, null, null,null);")));
by
formAjaxBehavior.getCallbackFunction()

With the override mentioned bellow.
#getCallbackFunction() will get you the ready-to-use javascript function. I
am not a wiQuery expert so I don't know where exactly you have to use this
statement... (something like new JsScope(statement)?)

Maybe Ernesto or Hielke may help you more on this...

Best regards,
Sebastien.



On Tue, Jul 16, 2013 at 6:06 PM, Andrew Schetinin <ascheti...@gmail.com>wrote:

> Hi Sebastien,
>
> Thank you for the suggestion, but the trouble with the sample (and wiQuery)
> is that DialogButton is not a wicket component - it is a very simple
> object. There is no updateAjaxAttributes() to change.
>
> As I explained, the form submit there works by a plain call from
> JavaScript, and that call does not work anymore because of the missing
> wicketSubmitFormById() function.
>
> It seems to me that the only way to extend Dialog in wiQuery is through
> JavaScript - at least everything related to reaction on the button clicks.
>
> Regards,
>
> Andrew
>
> --
> Andrew Schetinin
>
>
> On Tue, Jul 16, 2013 at 6:33 PM, Sebastien <seb...@gmail.com> wrote:
>
> > Hi Andrew,
> >
> > You have to override your ajaxbehavior#updateAjaxAttributes()
> >
> > protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
> > {
> >     super.updateAjaxAttributes(attributes);
> >
> >     attributes.setMethod(Method.POST); //if you wish to post
> >     attributes.setFormId("yourFormId");
> > }
> >
> > Best regards,
> > Sebastien.
> >
> >
> > On Tue, Jul 16, 2013 at 5:21 PM, Andrew Schetinin <ascheti...@gmail.com
> > >wrote:
> >
> > > Hi,
> > >
> > > I've just upgraded from Wicket 1.4 to 6.9, and (among lots of other
> > > problems) I have a trouble with porting the code that submitted a form
> > from
> > > within a wiQuery dialog.
> > >
> > > My code is based on the sample that can be found here:
> > >
> > >
> >
> http://code.google.com/p/wiquery/source/browse/examples/wiquery-examples/src/main/resources/org/odlabs/wiquery/examples/dialog/DialogPage.java?r=407
> > >
> > > The trick here was that the Dialog contains a form which has to be
> > > submitted when OK button is clicked, and that was done with the
> following
> > > code:
> > >
> > >                 buttonsAdv.add(new DialogButton("Save",
> > >
> > > JsScope.quickScope("wicketSubmitFormById('form','" +
> > >
> > > formAjaxBehavior.getCallbackUrl() +
> > >                                                 "', null, null, null,
> > null,
> > > null);")));
> > >
> > > Unfortunately, in Wicket 6.9 this code fails to find the function
> > > wicketSubmitFormById()
> > >
> > > I also have a feeling that in my previous attempt to port this code to
> > > Wicket 6.6 the same functionality worked fine.
> > >
> > > The question is - how is it possible to submit a form from JS?
> > >
> > > Regards,
> > >
> > > Andrew
> > >
> > > --
> > > Andrew Schetinin
> > >
> >
>

Reply via email to