Hi, I'd add it to the AjaxButton that submits the form. Yes, it should work with 6.x.
I have never used a *synchronous* Ajax call in my apps. This is something that is highly discurraged by everyone (specifications, books, articles, etc.). A synchronous call will make your browser unusable during the call! But this is the only way I see to get your key during the form submit processing. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Jan 16, 2017 at 8:36 AM, James Selvakumar <ja...@mcruncher.com> wrote: > Hi Martin, > > Thanks a lot for your response. > Can I add this behavior directly to the form or should this be added to a > form component? > Will this work on Wicket 6.x? > > On Mon, Jan 16, 2017 at 3:29 PM, Martin Grigorov <mgrigo...@apache.org> > wrote: > > > Hi, > > > > The easiest way I see is to use onBeforeSend() callback listener on the > > Ajax submit behavior of the form. > > There you can do a **synchronous** Ajax call to get your key and then > > modify (i.e. encrypt) the data to be sent. > > > > Martin Grigorov > > Wicket Training and Consulting > > https://twitter.com/mtgrigorov > > > > On Mon, Jan 16, 2017 at 8:08 AM, James Selvakumar <ja...@mcruncher.com> > > wrote: > > > > > Hi all, > > > > > > I have this requirement where some of the data entered by the user are > to > > > be encrypted in the client side before the request is submitted to the > > > Wicket server even though the communication is over HTTPS. > > > > > > I am thinking of having some JavaScript code in the client which shall > > > intercept the form submission, request the Server for a randomly > > generated > > > key and encrypt the form data using the key received and then submit > the > > > form again. > > > > > > Any idea how to achieve this in Wicket? > > > > > > -- > > > Thanks & regards > > > James > > > > > > > > > -- > Thanks & regards > James Selvakumar >