Hi Jeff, could you use an AjaxSubmitLink and treat unauthenticated users as a validation failure so that you end up in #onError() of your link? That way, you can keep the submission login in Form#onSubmit()...
Bye Stefan Jeff Schneller wrote: > Easy enough to implement when 1 form with submit button on page. Much more > difficult when there are N forms with a submit button on a page. Each modal > would need to have a different onSubmit() behavior so that the correct form > is processed after the authentication occurs. > > > > On Sunday, July 14, 2013 at 11:38 PM, Paul BorČ™ wrote: > >> So what's stopping you from doing so again? >> >> You simply keep the same conditions, if not logged you show the modal pop-up >> with the authentication form. User clicks submit on the login form and >> inside the onSubmit() of the form/button you run your authentication and if >> it passes you post the data, if not you give an error. >> >> ~ Thank you, >> Paul Bors >> >> On Jul 14, 2013, at 10:07 AM, Jeff Schneller <j...@mootus.com >> (mailto:j...@mootus.com)> wrote: >> >>> Paul - >>> >>> That is how I am doing it. But I want the buttons to always appear even if >>> not logged in. Then when clicked a modal is shown to login through a form >>> and then the button action is finally executed. >>> >>> On Sunday, July 14, 2013 at 1:15 AM, Paul Bors wrote: >>>> Keep a flag in your customized Session for when the user is logged in. I >>>> keep the ID of the user record from the db so that if I need the user POJO >>>> I can lazy load it later (say to e-mail the user or to show the user's >>>> name under the My Profile page etc). >>>> >>>> If that is null, then show your pop-up, if valid then show your button. >>>> >>>> ~ Thank you, >>>> Paul Bors >>>> >>>> -----Original Message----- >>>> From: Jeff Schneller [mailto:j...@mootus.com] >>>> Sent: Sunday, July 14, 2013 12:13 AM >>>> To: users@wicket.apache.org (mailto:users@wicket.apache.org) >>>> Subject: Mutliple forms - single login popup >>>> >>>> Using 1.5.x. >>>> >>>> I have multiple forms (minimum of 2 but could be any number) on my page >>>> being put on the page as a ListView. Each form has its own model and 2 >>>> buttons within it that perform some action on its model. Similar to the >>>> facebook newsfeed where each news article has its own like and comment >>>> button. I have a login form on the page being shown as a jquery modal >>>> window. >>>> >>>> My requirement is that the user must be logged in before either button >>>> click is processed. I have code that works but only for one form. >>>> >>>> I want the button click to perform the business logic when user is logged >>>> in and if not logged in - show a modal login form, after successful login >>>> then perform the business logic. >>>> >>>> What is the best/easiest way to do this? >>>> >>>> Jeff Schneller >>>> Co-Founder/CTO, Mootus (http://www.mootus.com) j...@mootus.com >>>> (mailto:a...@mootus.com) >>>> M: 1-617-851-0200 >>>> Skype: jeff.schneller >>>> >>>> LinkedIn (http://www.linkedin.com/in/jeffschneller) | Twitter >>>> (https://twitter.com/Mootusco) | Website (http://www.mootus.com/) >>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> (mailto:users-unsubscr...@wicket.apache.org) >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> (mailto:users-h...@wicket.apache.org) >>>> >>> >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> (mailto:users-unsubscr...@wicket.apache.org) >> For additional commands, e-mail: users-h...@wicket.apache.org >> (mailto:users-h...@wicket.apache.org) >> >> > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org