Re: rememberMe not working in 6.19

2015-04-28 Thread vp143
Great! So I assume that will be available in 6.20?
Is there an ETA for that?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/rememberMe-not-working-in-6-19-tp4670527p4670533.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



Re: rememberMe not working in 6.19

2015-04-28 Thread Martin Grigorov
On Apr 28, 2015 4:54 PM, vp143 vishal.po...@cipriati.co.uk wrote:

 Great! So I assume that will be available in 6.20?

Yes

 Is there an ETA for that?

Should be soon. It's been a while since 6.19


 --
 View this message in context:
http://apache-wicket.1842946.n4.nabble.com/rememberMe-not-working-in-6-19-tp4670527p4670533.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



Re: load JS after page refresh

2015-04-28 Thread Chris
Perfect, thanks  a lot!

Chris


 Am 27.04.2015 um 13:21 schrieb Sven Meier s...@meiers.net:
 
 Hi,
 
 I've tried your sample project and identified the problem:
 
 Since you're adding the whole page to the AjaxRequestTarget, Wicket will 
 immediately issue a redirect to the current page.
 But at the end of the current request, the page is detached - this removes 
 all temporary behaviors.
 
 The page is then re-rendered after the redirect, but the behavior is no 
 longer present to write any JavaScript to the header.
 
 You could change your behavior to mark itself as temporary only *after* it 
 has done its duty:
 
@Override
public void renderHead(Component component, 
 IHeaderResponse response) {
super.renderHead(component, response);
 response.render(OnDomReadyHeaderItem.forScript(alert('test')));
alerted = true;
}
 
@Override
public boolean isTemporary(Component component) {
return alerted;
}
 
 Regards
 Sven
 
 
 On 27.04.2015 12:10, Chris wrote:
 I understand - I just made a quick start project with the code below that 
 shows when setting isTemporary=true JS is not called.
 https://github.com/cat1000/loadjs https://github.com/cat1000/loadjs 
 https://github.com/cat1000/loadjs https://github.com/cat1000/loadjs
 
 If anyone can point me to the error, it would be great.
 
 Thanks, Chris
 
 Am 27.04.2015 um 10:59 schrieb Martin Grigorov mgrigo...@apache.org:
 
 I am not sure what problem you face but it should be 'true'.
 Otherwise the behavior remains attached to the page and any following
 re-renderings of the page will execute this JS code again.
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Mon, Apr 27, 2015 at 11:52 AM, Chris chris...@gmx.at wrote:
 
 Hi all,
 
 thanks Martin. I have to set isTemporary=false, otherwise the JS will not
 be called.
 
 
 public void onClick(AjaxRequestTarget target) {
target.add(getPage().add(new Behavior() {
@Override
public void renderHead(Component component,
 IHeaderResponse response) {
super.renderHead(component, response);
 
 response.render(OnDomReadyHeaderItem.forScript(call...));
}
 
@Override
public boolean isTemporary(Component component) {
return false;
}
}));
 
  }
 
 
 Chris
 
 Am 27.04.2015 um 08:49 schrieb Martin Grigorov mgrigo...@apache.org:
 
 Hi,
 
 You can create a Behavior with #renderHead() to render the JS and
 #isTemporary() {return true} so that it is removed automatically after
 the
 rendering.
 Add this Behavior in #onClick() to the page.
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Mon, Apr 27, 2015 at 5:15 AM, Chris chris...@gmx.at wrote:
 
 Hi all,
 
 how is it possible to load a JS function after a specific page refresh
 based on an ajax link click?
 
 Link link = new AjaxFallbackLink(link) {
   @Override
   public void onClick(AjaxRequestTarget target) {
   target.add(getPage());
   }
 };
 
 Thanks, Chris
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: 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


rememberMe not working in 6.19

2015-04-28 Thread Vishal Popat
Hi,

I am currently using wicket 6.16 and wanting to upgrade to 6.19.
I am using a LoginPanel using the rememberMe feature something like this:

IAuthenticationStrategy strategy = 
getApplication().getSecuritySettings().getAuthenticationStrategy();

if (WiaSession.get().signIn(getUsername(), 
getPassword())) {
if (rememberMe == true) {
System.out.println(rememberMe is true, 
so saving username and password);
strategy.save(getUsername(), 
getPassword());
}
else {
strategy.remove();
}

…

When using 6.19 and restarting the server (I am not sure if it happens without 
restarting i.e. waiting a long time), I have to log in again.
This does not happen with 6.16, 6.17 and 6.18, so it is difference in 6.18 and 
6.19 i.e. I am already logged in.

Does anyone know why this could be? Of course it could be possible that I have 
custom code that no longer works with 6.19.

Any hints would be appreciated!

Regards
Vishal


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: rememberMe not working in 6.19

2015-04-28 Thread Maxim Solodovnik
This is known behavior, hopefully will be fixed in the next version :)

On Tue, Apr 28, 2015 at 3:29 PM, Vishal Popat vishal.po...@cipriati.co.uk
wrote:

 Hi,

 I am currently using wicket 6.16 and wanting to upgrade to 6.19.
 I am using a LoginPanel using the rememberMe feature something like this:

 IAuthenticationStrategy strategy =
 getApplication().getSecuritySettings().getAuthenticationStrategy();

 if (WiaSession.get().signIn(getUsername(),
 getPassword())) {
 if (rememberMe == true) {
 System.out.println(rememberMe is
 true, so saving username and password);
 strategy.save(getUsername(),
 getPassword());
 }
 else {
 strategy.remove();
 }

 …

 When using 6.19 and restarting the server (I am not sure if it happens
 without restarting i.e. waiting a long time), I have to log in again.
 This does not happen with 6.16, 6.17 and 6.18, so it is difference in 6.18
 and 6.19 i.e. I am already logged in.

 Does anyone know why this could be? Of course it could be possible that I
 have custom code that no longer works with 6.19.

 Any hints would be appreciated!

 Regards
 Vishal


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
WBR
Maxim aka solomax


Re: rememberMe not working in 6.19

2015-04-28 Thread Martin Grigorov
It is fixed already.
On Apr 28, 2015 12:32 PM, Maxim Solodovnik solomax...@gmail.com wrote:

 This is known behavior, hopefully will be fixed in the next version :)

 On Tue, Apr 28, 2015 at 3:29 PM, Vishal Popat vishal.po...@cipriati.co.uk
 
 wrote:

  Hi,
 
  I am currently using wicket 6.16 and wanting to upgrade to 6.19.
  I am using a LoginPanel using the rememberMe feature something like this:
 
  IAuthenticationStrategy strategy =
  getApplication().getSecuritySettings().getAuthenticationStrategy();
 
  if (WiaSession.get().signIn(getUsername(),
  getPassword())) {
  if (rememberMe == true) {
  System.out.println(rememberMe is
  true, so saving username and password);
  strategy.save(getUsername(),
  getPassword());
  }
  else {
  strategy.remove();
  }
 
  …
 
  When using 6.19 and restarting the server (I am not sure if it happens
  without restarting i.e. waiting a long time), I have to log in again.
  This does not happen with 6.16, 6.17 and 6.18, so it is difference in
 6.18
  and 6.19 i.e. I am already logged in.
 
  Does anyone know why this could be? Of course it could be possible that I
  have custom code that no longer works with 6.19.
 
  Any hints would be appreciated!
 
  Regards
  Vishal
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 WBR
 Maxim aka solomax