Hi, On Mon, Jul 30, 2012 at 5:09 PM, tmaus <loum...@yahoo.com> wrote: > Hi there .. > > Setup a panel that covers both, a facebook-login button and a user state > sensitive link. > > The link should be disabled unless we find a user in the session. > > The Ajax FB link looks like: > > AjaxLink fbLink = new AjaxLink("fb") { > public void onClick(AjaxRequestTarget target) { > > > getPage().getRequestCycle().scheduleRequestHandlerAfterCurrent(new > RedirectRequestHandler("http://www.facebook.com/login.php?api_key=" + > pcs.getFbApiKey() + "&v=1.0")); > } > }; > add(fbLink).setEnabled(session.getAttribute("user") == null); > > It works like a charm. > > > The link looks like: > adminPageLink = new Link("adminLink",model) { > public void onClick() { > setResponsePage(new HomeAdminPage()); > } > > protected void onConfigure() { > LOG.debug("onConfigure");
Is this debug statement logged after FB returns ? Also add the value of session.getAttribute("user") in the log message. > setVisible(session.getAttribute("user") != null); > } > }; > > add(adminPageLink); When you update an invisible component in an Ajax request you should also do: invisibleComponent.setOutputMarkupPlaceholder(true) Check the javadoc of this method for more details. But I think the second render (after FB returns) the request is not Ajax anymore, so this shouldn't be necessary. > > This link is properly rendered as long as the FB login page has not been > called and returned. > > Once the user is properly logged into FB, the adminLink is not clickable (no > tag is rendered) > > Im still quite new to Wicket and any help your be appreciated. > > Best regards > > Thorsten > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Link-is-disabled-after-Ajax-request-tp4650870.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org