Re: AjaxFormComponentUpdatingBehavior broken after invalid submit

2011-10-28 Thread Martin Grigorov
On Fri, Oct 28, 2011 at 7:22 AM, Hans Lesmeister 2
hans.lesmeis...@lessy-software.de wrote:
 Hi,

 did you already try a call to form.modelChanged() in onUpdate?

form.modelChanging() is even more important because it marks the page
as dirty and thus saves the new state of it at the end of the request


 -
 --
 Regards,
 Hans

 http://cantaa.de

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-broken-after-invalid-submit-tp3945964p3946955.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



~ as separator in urls

2011-10-28 Thread martin.dilger
Hi, 

since https://issues.apache.org/jira/browse/WICKET-4061, we use ~ as
url-separator, this leads to enormous problems and prevents us from
upgrading from 1.5.0 to 1.5.1.

We have an apache which has mod_security enabled, and all Ajax-Requests are
blocked, the same could happen if an apache is active which has mod_userdir
active (http://httpd.apache.org/docs/mod/mod_userdir.html).

I would like to start a discussion, whether this is really a good idea to
use ~ as a separator.
In my mind, it is not since ~ has its own semantics and should not be used
as a separator.

What is your opinion?

Regards 

Martin

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/as-separator-in-urls-tp3947088p3947088.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: Multi-tabs and back-button support 1.5.2

2011-10-28 Thread Charlie Midtlyng
I have now created an issue on jira with the actual problems described above.
 
https://issues.apache.org/jira/browse/WICKET-4182
https://issues.apache.org/jira/browse/WICKET-4182 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multi-tabs-and-back-button-support-1-5-2-tp3943445p3947091.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: ~ as separator in urls

2011-10-28 Thread Martin Grigorov
Hi,

On Fri, Oct 28, 2011 at 9:00 AM, martin.dilger
martin.dil...@googlemail.com wrote:
 Hi,

 since https://issues.apache.org/jira/browse/WICKET-4061, we use ~ as
 url-separator, this leads to enormous problems and prevents us from
 upgrading from 1.5.0 to 1.5.1.

 We have an apache which has mod_security enabled, and all Ajax-Requests are
 blocked, the same could happen if an apache is active which has mod_userdir
 active (http://httpd.apache.org/docs/mod/mod_userdir.html).

~ is allowed in the url path by http specs
do these Apache modules fail without letting the next module process the url ?

for example I'd expect from mod_userdir to check for existence of a
user with this name and if there is no such then let the request/url
be processed by the next Apache module.


 I would like to start a discussion, whether this is really a good idea to
 use ~ as a separator.
 In my mind, it is not since ~ has its own semantics and should not be used
 as a separator.

 What is your opinion?

 Regards

 Martin

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/as-separator-in-urls-tp3947088p3947088.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



Application Home page - Firefox issue

2011-10-28 Thread Groot, Mathijs de (IDT Competence Java)
Hi,

I've a really strange problem with my home page when using Firefox (3.6.32).
I'm currently using Wicket version 1.5.2

When typing in a textField, the model object is always null when submitted!

This is only the case when my Page is my application home page, and only with 
Firefox.
(thus: When it is not my application home page, or using Chrome or IE it is 
working fine).

I think it's a bug in Wicket...

Can someone help me?
Or should I just create a new Wicket a bug report?


A example that will reproduce this issue:
You will see that [input] is always null in Firefox (3.6)!

public class TestPage extends WebPage {
private static final long serialVersionUID = 5676036334073650103L;
private String input;

public TestPage() {
final Label label = new Label(label, start, rendered #  + 
getRenderCount());
add(label);
final FormString form = new FormString(form, new 
PropertyModelString(this, input)) {
private static final long serialVersionUID = -949169730520245L;

@Override
public void onSubmit() {
label.setDefaultModelObject(input = [ + input + ] rendered # 
 + getRenderCount());
}
};
add(form);
form.add(new TextFieldString(input, new PropertyModelString(this, 
input)));
form.add(new SubmitLink(submit));
}
}

NB: Make sure the following is in your WebApplication

@Override
public Class? extends Page getHomePage() {
return TestPage.class;
}

Corresponding Mark-up:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; 
xmlns:wicket=http://wicket.apache.org/;
head
meta http-equiv=X-UA-Compatible content=IE=8/
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
title[Application Title]/title
/head
body
   form wicket:id=form action=# method=post
input wicket:id=input type=text class=textfield /  
a href=# wicket:id=submitsubmit/a
   /form
   div wicket:id=label[label]/div
/body
/html

Best regards,

Mathijs

Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



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



Re: Application Home page - Firefox issue

2011-10-28 Thread Martin Grigorov
Hi,

On Fri, Oct 28, 2011 at 9:54 AM, Groot, Mathijs de (IDT Competence
Java) math.de.gr...@logica.com wrote:
 Hi,

 I've a really strange problem with my home page when using Firefox (3.6.32).
 I'm currently using Wicket version 1.5.2

 When typing in a textField, the model object is always null when submitted!

 This is only the case when my Page is my application home page, and only with 
 Firefox.
 (thus: When it is not my application home page, or using Chrome or IE it is 
 working fine).

 I think it's a bug in Wicket...

Does it work in newer versions of Firefox ?
Wicket process the form submit the same way for all browsers. See with
Firebug what parameteres are sent to the server-side.


 Can someone help me?
 Or should I just create a new Wicket a bug report?


 A example that will reproduce this issue:
 You will see that [input] is always null in Firefox (3.6)!

 public class TestPage extends WebPage {
    private static final long serialVersionUID = 5676036334073650103L;
    private String input;

    public TestPage() {
        final Label label = new Label(label, start, rendered #  + 
 getRenderCount());
        add(label);
        final FormString form = new FormString(form, new 
 PropertyModelString(this, input)) {
            private static final long serialVersionUID = -949169730520245L;

            @Override
            public void onSubmit() {
                label.setDefaultModelObject(input = [ + input + ] rendered 
 #  + getRenderCount());
            }
        };
        add(form);
        form.add(new TextFieldString(input, new 
 PropertyModelString(this, input)));
        form.add(new SubmitLink(submit));
    }
 }

 NB: Make sure the following is in your WebApplication

    @Override
    public Class? extends Page getHomePage() {
        return TestPage.class;
    }

 Corresponding Mark-up:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; 
 xmlns:wicket=http://wicket.apache.org/;
 head
 meta http-equiv=X-UA-Compatible content=IE=8/
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 title[Application Title]/title
 /head
 body
   form wicket:id=form action=# method=post
    input wicket:id=input type=text class=textfield /
    a href=# wicket:id=submitsubmit/a
   /form
   div wicket:id=label[label]/div
 /body
 /html

 Best regards,

 Mathijs

 Think green - keep it on the screen.

 This e-mail and any attachment is for authorised use by the intended 
 recipient(s) only. It may contain proprietary material, confidential 
 information and/or be subject to legal privilege. It should not be copied, 
 disclosed to, retained or used by, any other party. If you are not an 
 intended recipient then please promptly delete this e-mail and any attachment 
 and all copies and inform the sender. Thank you.



 -
 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



RE: Application Home page - Firefox issue

2011-10-28 Thread Groot, Mathijs de (IDT Competence Java)
Hi Martin,

Thanks for your quick reply.

a) No, it is not working in Firefox 7.0.1 as well
b) I know form submitting should be (and is) the same for all browsers, that is 
why it's so strange.
c) I don't have much experience with analysing the post requests, but I see the 
following when submitting test-input:

1. POST myApp/?5-1.IFormSubmitListener-form  Status: 302 Moved Temporarily
   Post Parameters:
:submit  x
  input  test-input
2. GET myApp/?5-1.IFormSubmitListener-form  Status: 302 Moved Temporarily
Reply: 
Loading source failed for: 
http://localhost:8080/myApp/?5-1.IFormSubmitListener-form
3. GET TestPage?6

Looking at this, the first get (step 2) fails, and the page is reloaded (step 
3).

But how can I make this simple form submitting work in Firefox?
And I don't understand why this is only the case when the page is my 
Application Home page.



P.s. If more people are struggling with this problem, I've made a workaround to 
get to my (working) home page:
(I know it's not a nice way of working...)

public class RedirectToHomePage extends WebPage {
private static final long serialVersionUID = -8505922834510539508L;

public RedirectToHomePage() {
setResponsePage(HomePage.class);
}
}

In my WebApplication

@Override
public Class? extends Page getHomePage() {
   return RedirectToHomePage.class;
}



-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: vrijdag 28 oktober 2011 10:00
To: users@wicket.apache.org
Subject: Re: Application Home page - Firefox issue

Hi,

On Fri, Oct 28, 2011 at 9:54 AM, Groot, Mathijs de (IDT Competence
Java) math.de.gr...@logica.com wrote:
 Hi,

 I've a really strange problem with my home page when using Firefox (3.6.32).
 I'm currently using Wicket version 1.5.2

 When typing in a textField, the model object is always null when submitted!

 This is only the case when my Page is my application home page, and only with 
 Firefox.
 (thus: When it is not my application home page, or using Chrome or IE it is 
 working fine).

 I think it's a bug in Wicket...

Does it work in newer versions of Firefox ?
Wicket process the form submit the same way for all browsers. See with
Firebug what parameteres are sent to the server-side.


 Can someone help me?
 Or should I just create a new Wicket a bug report?


 A example that will reproduce this issue:
 You will see that [input] is always null in Firefox (3.6)!

 public class TestPage extends WebPage {
    private static final long serialVersionUID = 5676036334073650103L;
    private String input;

    public TestPage() {
        final Label label = new Label(label, start, rendered #  + 
 getRenderCount());
        add(label);
        final FormString form = new FormString(form, new 
 PropertyModelString(this, input)) {
            private static final long serialVersionUID = -949169730520245L;

            @Override
            public void onSubmit() {
                label.setDefaultModelObject(input = [ + input + ] rendered 
 #  + getRenderCount());
            }
        };
        add(form);
        form.add(new TextFieldString(input, new 
 PropertyModelString(this, input)));
        form.add(new SubmitLink(submit));
    }
 }

 NB: Make sure the following is in your WebApplication

    @Override
    public Class? extends Page getHomePage() {
        return TestPage.class;
    }

 Corresponding Mark-up:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; 
 xmlns:wicket=http://wicket.apache.org/;
 head
 meta http-equiv=X-UA-Compatible content=IE=8/
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 title[Application Title]/title
 /head
 body
   form wicket:id=form action=# method=post
    input wicket:id=input type=text class=textfield /
    a href=# wicket:id=submitsubmit/a
   /form
   div wicket:id=label[label]/div
 /body
 /html

 Best regards,

 Mathijs

 Think green - keep it on the screen.

 This e-mail and any attachment is for authorised use by the intended 
 recipient(s) only. It may contain proprietary material, confidential 
 information and/or be subject to legal privilege. It should not be copied, 
 disclosed to, retained or used by, any other party. If you are not an 
 intended recipient then please promptly delete this e-mail and any attachment 
 and all copies and inform the sender. Thank you.



 -
 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



Think green - keep it on the screen.


Re: Application Home page - Firefox issue

2011-10-28 Thread Martin Grigorov
Create a quickstart and attach it to Jira.

On Fri, Oct 28, 2011 at 11:50 AM, Groot, Mathijs de (IDT Competence
Java) math.de.gr...@logica.com wrote:
 Hi Martin,

 Thanks for your quick reply.

 a) No, it is not working in Firefox 7.0.1 as well
 b) I know form submitting should be (and is) the same for all browsers, that 
 is why it's so strange.
 c) I don't have much experience with analysing the post requests, but I see 
 the following when submitting test-input:

 1. POST myApp/?5-1.IFormSubmitListener-form  Status: 302 Moved Temporarily
   Post Parameters:
        :submit  x
          input  test-input
 2. GET myApp/?5-1.IFormSubmitListener-form  Status: 302 Moved Temporarily
        Reply:
        Loading source failed for: 
 http://localhost:8080/myApp/?5-1.IFormSubmitListener-form
 3. GET TestPage?6

 Looking at this, the first get (step 2) fails, and the page is reloaded (step 
 3).

 But how can I make this simple form submitting work in Firefox?
 And I don't understand why this is only the case when the page is my 
 Application Home page.



 P.s. If more people are struggling with this problem, I've made a workaround 
 to get to my (working) home page:
 (I know it's not a nice way of working...)

 public class RedirectToHomePage extends WebPage {
    private static final long serialVersionUID = -8505922834510539508L;

    public RedirectToHomePage() {
        setResponsePage(HomePage.class);
    }
 }

 In my WebApplication

 @Override
 public Class? extends Page getHomePage() {
   return RedirectToHomePage.class;
 }



 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: vrijdag 28 oktober 2011 10:00
 To: users@wicket.apache.org
 Subject: Re: Application Home page - Firefox issue

 Hi,

 On Fri, Oct 28, 2011 at 9:54 AM, Groot, Mathijs de (IDT Competence
 Java) math.de.gr...@logica.com wrote:
 Hi,

 I've a really strange problem with my home page when using Firefox (3.6.32).
 I'm currently using Wicket version 1.5.2

 When typing in a textField, the model object is always null when submitted!

 This is only the case when my Page is my application home page, and only 
 with Firefox.
 (thus: When it is not my application home page, or using Chrome or IE it is 
 working fine).

 I think it's a bug in Wicket...

 Does it work in newer versions of Firefox ?
 Wicket process the form submit the same way for all browsers. See with
 Firebug what parameteres are sent to the server-side.


 Can someone help me?
 Or should I just create a new Wicket a bug report?


 A example that will reproduce this issue:
 You will see that [input] is always null in Firefox (3.6)!

 public class TestPage extends WebPage {
    private static final long serialVersionUID = 5676036334073650103L;
    private String input;

    public TestPage() {
        final Label label = new Label(label, start, rendered #  + 
 getRenderCount());
        add(label);
        final FormString form = new FormString(form, new 
 PropertyModelString(this, input)) {
            private static final long serialVersionUID = 
 -949169730520245L;

            @Override
            public void onSubmit() {
                label.setDefaultModelObject(input = [ + input + ] rendered 
 #  + getRenderCount());
            }
        };
        add(form);
        form.add(new TextFieldString(input, new 
 PropertyModelString(this, input)));
        form.add(new SubmitLink(submit));
    }
 }

 NB: Make sure the following is in your WebApplication

    @Override
    public Class? extends Page getHomePage() {
        return TestPage.class;
    }

 Corresponding Mark-up:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; 
 xmlns:wicket=http://wicket.apache.org/;
 head
 meta http-equiv=X-UA-Compatible content=IE=8/
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 title[Application Title]/title
 /head
 body
   form wicket:id=form action=# method=post
    input wicket:id=input type=text class=textfield /
    a href=# wicket:id=submitsubmit/a
   /form
   div wicket:id=label[label]/div
 /body
 /html

 Best regards,

 Mathijs

 Think green - keep it on the screen.

 This e-mail and any attachment is for authorised use by the intended 
 recipient(s) only. It may contain proprietary material, confidential 
 information and/or be subject to legal privilege. It should not be copied, 
 disclosed to, retained or used by, any other party. If you are not an 
 intended recipient then please promptly delete this e-mail and any 
 attachment and all copies and inform the sender. Thank you.



 -
 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

 

Re: An extensive RIA technology comparison matrix including Wicket

2011-10-28 Thread Andrea Del Bene
That's why I don't like a statement like UI programming on client-side 
with Java. You are just giving the impression of programming your GUI 
in Java, but in the end is a lot of JavaScript, and this doesn't help 
code maintenance as pointed out by Eelco .
I know that GWT is good at mimicking desktop style but you can do it 
also with Wicket with the right components.

Ugh, I mean 'just do that in JavaScript'

On Thu, Oct 27, 2011 at 7:07 PM, Eelco Hillenius
eelco.hillen...@gmail.com  wrote:

To be honest, I don't think the comparison matrix is that bad. I would
consider a framework like Vaadin over Wicket if all I wanted a typical
desktop style only (menu bar, content frames + layout manager, fancy
widgets) only type of application, what they call application
oriented, especially if it would benefit a lot from client-side UI
management.

Or just do that in Java. I can tell you from experience that
developing (and e.g. debugging!) with GWT is painful on many different
levels. I like how Vaadin markets itself, what it's goals are etc, but
I can't imagine not stumbling into the same kind of hassle that comes
with developing with GWT. Might even make it worse, as it's yet
another abstraction over it.

My2c,

Eelco


-
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



Determine the latest page in multi tabbed browsing

2011-10-28 Thread Dirk Arnoldt

Hi,

I'm facing a problem with multi tabbed browsing.

In a wicket application I currently detect browser navigation (back 
button) by means of timestamps. As a result I display a warning to the 
user telling him that he should not use the back button and subsequently 
forward him to the next page in the browser history.


This works for me as long as the user doesn't use multiple browser tabs 
or windows. Is there a way to determine which pages belongs to the same 
browser tab/window?


Another problem with my current solution is, that the user can jump 
between arbitray pages in browser history. I want to redirect the user 
to the latest page from my application - which must not be the newest 
page in browser history. Is there a way to determine the latest page in 
a wicket session?


Thanks
Dirk

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



Re: ~ as separator in urls

2011-10-28 Thread martin.dilger
Hi Martin,

thanks for your reply.
Well, could be, I´m not sure, what all these apache modules do, 
our problem is, that mod_security in apache denies all request with '~' in
the URL, what we get is 404, which per Default looks like the Application
would not respond on Button clicks, since no failure-handler is active.

I know, that '~' is generally allowed in uris, but I wanted to discuss
whether this is really a good idea.
I wonder, whether we are the only ones with this problem?

Regards

Martin

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/as-separator-in-urls-tp3947088p3947748.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: AjaxFormComponentUpdatingBehavior broken after invalid submit

2011-10-28 Thread Russell Pitre
Great!  That's exactly what I needed.  Thanks.

-Russ

On Fri, Oct 28, 2011 at 2:56 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 On Fri, Oct 28, 2011 at 7:22 AM, Hans Lesmeister 2
 hans.lesmeis...@lessy-software.de wrote:
  Hi,
 
  did you already try a call to form.modelChanged() in onUpdate?

 form.modelChanging() is even more important because it marks the page
 as dirty and thus saves the new state of it at the end of the request

 
  -
  --
  Regards,
  Hans
 
  http://cantaa.de
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-broken-after-invalid-submit-tp3945964p3946955.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




Re: wicketstuff-push examples working across browsers

2011-10-28 Thread Soheb Mahmood
Hello Martin and Seb,

Just to drop an email to let you know how I'm doing so far, I've had a go 
yesterday, and to some extent, this morning at trying to get the master branch 
running, as I feel it is important to at least try and give feedback early as 
possible.

However, I've been struggling in trying to meet dependencies (it isn't anyone's 
fault but mine; I'm quite new to this and am doing this as a research project 
for our production application). I will try my best to actually get a 
wicketstuff-core snapshot, as well as a wicket snapshot and get the example 
running in IE.

Also, with Wicket 1.5.2 released recently, I assumed you'd get a stable version 
(even a RC) uploaded so at some point in the future I won't need to wrestle 
with snapshots any time soon.

Once again, many thanks for your time and effort.

Regards,
Soheb

- Original Message -
From: Martin Grigorov mgrigo...@apache.org
To: users@wicket.apache.org
Sent: Thursday, 27 October, 2011 3:01:54 PM
Subject: Re: wicketstuff-push examples working across browsers

On Thu, Oct 27, 2011 at 3:58 PM, Soheb Mahmood so...@humboldt.co.uk wrote:
 I just read my email again and I sounded really rude when asking my question. 
 What I mean to ask was, out of curiousity, if you were trying to get the IE7 
 browser+ working?

 I'm really sorry if I've offended you or anyone. I'm very embarrassed by that 
 tone in the email (it's not what I actually meant to say), and I really do 
 appreciate your hard work and effort towards wicketstuff (as I have seen on 
 git).

Did you try the latest code from wicketstuff/core master branch ?
Maybe it already works on IE...


 Soheb

 - Original Message -
 From: Sebastian nospam...@gmx.net
 To: users@wicket.apache.org
 Sent: Wednesday, 26 October, 2011 5:21:52 PM
 Subject: Re: wicketstuff-push examples working across browsers

 hi,

 cometd had a bug that affects websocket support in conjunction with
 chrome browsers. It is fixed in the latest 1.4.0RC1 release of cometd.
 We incorporated the changes (and fixed some other issues) in wicketstuff
 trunk. thus they will be available with the wicketstuff 1.5.2 release.

 Regards,
 Seb

 On 26.10.2011 10:25, Soheb Mahmood wrote:
 Hello everyone,

 I'm planning to use wicketstuff-core in an actual production environment, 
 and to be more specific, I'm planning to use push-cometd. I'm currently 
 using wicketstuff version 1.4.14 to match the current version of Wicket we 
 are using in production.

 I got the example to run, and one of the things I wondered was what is the 
 browser support aimed for push-cometd? So far, I can only get the cometd 
 example working in Firefox and Opera, and there is a lack of support for 
 Google Chrome 14.0.835.202 nor Internet Explorer 7. I can get the Wicket 
 Timer example working, but the reason we are thinking of implementing comet 
 into production is to minimize the request impact on our server, and with 
 the Wicket Timer example, that uses TimerPushService, which if we wanted 
 similar functionality, we could just use AjaxTimeoutBehavior instead. Even 
 the Basic Cometd test doesn't work under IE7 and Chrome.

 I was wondering if you were aware of this, and if you had any suggestions to 
 solve this cross-browser issue (at least from our end). It's also worth 
 noting that I haven't modified the push-parent-jdk-1.6 folder contents at 
 all.

 Many thanks,
 Soheb

 -
 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
 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


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



Re: popup to disapear on defaultdatatable paging

2011-10-28 Thread midikem
Well i got it to work after a while when i realized PagingNavigator not was
the only one i could use. So when i switched to AjaxPagingNavigator i found
this method onAjaxEvent that did what i wanted it to. Have another question
about DataTable though. Is it possible to change the headersToolbar for the
provider that at the moment shows Showing 9 to 9 of 9 would like to change
it to another language. Couldent find a method handling that.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/popup-to-disapear-on-defaultdatatable-paging-tp3943946p3948016.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: LDMs load too early - hold outdated application data.

2011-10-28 Thread Bertrand Guay-Paquet

Hi,
this wont be a standard behavior as it would add a lot of overhead. 
during listener processing you may load five LDMs with database 
queries and only one of them will be effected by the form submission - 

Then those four will not get loaded before rendering and there is no problem.  
Their models will be detached from after the last rendering, their LDMs 
unloaded, and with no getObject to load them before render, when this new 
detach-before-render is called, their internal state will still be detached.  
No double loading if you're not being used during event processing.  Or am I 
wrong?  If not, then perhaps it is feasible still to do this.  If wicket loads 
all models of form components regardless, then maybe it can be made more lazy.
Some LDMs could be loaded which we know won't be affected by the form 
processing. I think that was Igor's point. However, is there a way to 
datach _all_ models as is done after page rendering? This could be 
called explicitly if we want such behavior after form processing to 
detach everything between the listener and the renderer.


I still see 2 issues with this however in favor of forcing detachment of 
models between the listener and the renderer:
Issue 1: With an ajax form submit, some components could be triggering 
the load of LDMs in their onEvent for the default ajax event. They 
would have a tough time knowing that they should detach their models 
since this request is a form submit that invalidates their data. This 
can happen with other events as well.


Issue 2: With stateless ajax, IIRC the flow is the following:
s1-create new page (components can load some LDMs in constructors, 
onInitialize, etc.)

s2-invoke listener
s3-render ajax request target
During s1 some loaded LDMs could very well be invalidated by what is 
done in s2. The listener has no way of knowing about LDMs loaded by 
other components in the new page instance so it can't detach them.


In my opinion, these are 2 problems which are very hard to solve without 
systematic detaching of models between the listener and the renderer.


Regards,
Bertrand

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



Re: Determine the latest page in multi tabbed browsing

2011-10-28 Thread Igor Vaynberg
since wicket provides backbutton support why are you fighting it?

-igor

On Fri, Oct 28, 2011 at 2:22 AM, Dirk Arnoldt dirk.arn...@1und1.de wrote:
 Hi,

 I'm facing a problem with multi tabbed browsing.

 In a wicket application I currently detect browser navigation (back button)
 by means of timestamps. As a result I display a warning to the user telling
 him that he should not use the back button and subsequently forward him to
 the next page in the browser history.

 This works for me as long as the user doesn't use multiple browser tabs or
 windows. Is there a way to determine which pages belongs to the same browser
 tab/window?

 Another problem with my current solution is, that the user can jump between
 arbitray pages in browser history. I want to redirect the user to the latest
 page from my application - which must not be the newest page in browser
 history. Is there a way to determine the latest page in a wicket session?

 Thanks
 Dirk

 -
 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



Re: LDMs load too early - hold outdated application data.

2011-10-28 Thread Igor Vaynberg
On Fri, Oct 28, 2011 at 8:10 AM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 Hi,

 this wont be a standard behavior as it would add a lot of overhead.
 during listener processing you may load five LDMs with database queries and
 only one of them will be effected by the form submission -

 Then those four will not get loaded before rendering and there is no
 problem.  Their models will be detached from after the last rendering, their
 LDMs unloaded, and with no getObject to load them before render, when this
 new detach-before-render is called, their internal state will still be
 detached.  No double loading if you're not being used during event
 processing.  Or am I wrong?  If not, then perhaps it is feasible still to do
 this.  If wicket loads all models of form components regardless, then maybe
 it can be made more lazy.

 Some LDMs could be loaded which we know won't be affected by the form
 processing. I think that was Igor's point. However, is there a way to datach
 _all_ models as is done after page rendering? This could be called
 explicitly if we want such behavior after form processing to detach
 everything between the listener and the renderer.

getPage().detach();

 I still see 2 issues with this however in favor of forcing detachment of
 models between the listener and the renderer:
 Issue 1: With an ajax form submit, some components could be triggering the
 load of LDMs in their onEvent for the default ajax event. They would have
 a tough time knowing that they should detach their models since this request
 is a form submit that invalidates their data. This can happen with other
 events as well.

 Issue 2: With stateless ajax, IIRC the flow is the following:
 s1-create new page (components can load some LDMs in constructors,
 onInitialize, etc.)
 s2-invoke listener
 s3-render ajax request target
 During s1 some loaded LDMs could very well be invalidated by what is done in
 s2. The listener has no way of knowing about LDMs loaded by other components
 in the new page instance so it can't detach them.

 In my opinion, these are 2 problems which are very hard to solve without
 systematic detaching of models between the listener and the renderer.

and here is a simple counter example. your form has five dropdowns,
all of which are populated by various queries and all of which are not
effected by the submit. now on every single submit you have to run 10
queries instead of 5, for no good reason. the point being that right
now we leave the room for manual eviction - allowing both usecases to
be implemented (some models that are detached and others that are
not). by force-detaching everything we remove the possibility to
implement the usecase where certain models do keep their state. this
is, imho, unacceptable.

neither approach is perfect, but at least the current one leaves more
doors open.

further, in the project's lifetime this has only come up a few times,
so obviously it is somewhat well understood and not difficult to deal
with.

one minor improvement i can see is to allow the default model to
implement ieventsink and participate in event processing by default.
this should make it simpler to automatically detach certain models no
matter where they are on the page.

-igor



 Regards,
 Bertrand

 -
 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



Re: LDMs load too early - hold outdated application data.

2011-10-28 Thread Bertrand Guay-Paquet



I still see 2 issues with this however in favor of forcing detachment of
models between the listener and the renderer:
Issue 1: With an ajax form submit, some components could be triggering the
load of LDMs in their onEvent for the default ajax event. They would have
a tough time knowing that they should detach their models since this request
is a form submit that invalidates their data. This can happen with other
events as well.

Issue 2: With stateless ajax, IIRC the flow is the following:
s1-create new page (components can load some LDMs in constructors,
onInitialize, etc.)
s2-invoke listener
s3-render ajax request target
During s1 some loaded LDMs could very well be invalidated by what is done in
s2. The listener has no way of knowing about LDMs loaded by other components
in the new page instance so it can't detach them.

In my opinion, these are 2 problems which are very hard to solve without
systematic detaching of models between the listener and the renderer.

and here is a simple counter example. your form has five dropdowns,
all of which are populated by various queries and all of which are not
effected by the submit. now on every single submit you have to run 10
queries instead of 5, for no good reason. the point being that right
now we leave the room for manual eviction - allowing both usecases to
be implemented (some models that are detached and others that are
not). by force-detaching everything we remove the possibility to
implement the usecase where certain models do keep their state. this
is, imho, unacceptable.

neither approach is perfect, but at least the current one leaves more
doors open.

further, in the project's lifetime this has only come up a few times,
so obviously it is somewhat well understood and not difficult to deal
with.


While I don't dispute the claims about past problems, I think the new 
usages and architecture of Wicket changes things. The 2 issues I noted 
above are related to events (a new 1.5 feature, probably not used widely 
yet) and stateless ajax (still not widely used as I understand it).


With reusable components that can be inserted in any page, components 
that update persistent state cannot determine if getPage().detach(); 
should be called; hence they have to resort to calling it systematically.


Imagine a dashboard style stateless-ajax interface where the choice of 
components is up to the user (like in JIRA) and some components can 
modify state. These components would need to know in which context they 
are used to decide whether to call getPage().detach(); or not. Doesn't 
this defeat some of the purpose of reusable components?


Bertrand

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



Re: LDMs load too early - hold outdated application data.

2011-10-28 Thread Igor Vaynberg
i think you are blowing this way out of proportion.

this only affects components that (A) modify their own model but do
not update it and *also* (B) have their model loaded for some reason
before they update it.

(B) is very rare - thats why this very rarely causes a problem.

we have always advertised that we make no guarantees as to when the
object's model is loaded. taking that into account it stands to reason
that if you do something like this:

Obect o=ddc.getmodelobject(); // or by implicitly using the object
that this points to
deleteFromDatabase(o);

you should realize that you have touched the ddc, possibly dirtying
its state and causing its lazy models to be loaded. you have also
modified the ddc's state without letting it know. it is reasonable
that you should be expected to synchronize this change:

ddc.getchoices().remove(o);

of course the easiest way to do that is to blanket

ddc.detach();

it is also important to note that other models should not be
effected because there is no reason for wicket to load them, so in the
example of the dashboard everything should work fine.

-igor


On Fri, Oct 28, 2011 at 9:36 AM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

 I still see 2 issues with this however in favor of forcing detachment of
 models between the listener and the renderer:
 Issue 1: With an ajax form submit, some components could be triggering
 the
 load of LDMs in their onEvent for the default ajax event. They would
 have
 a tough time knowing that they should detach their models since this
 request
 is a form submit that invalidates their data. This can happen with other
 events as well.

 Issue 2: With stateless ajax, IIRC the flow is the following:
 s1-create new page (components can load some LDMs in constructors,
 onInitialize, etc.)
 s2-invoke listener
 s3-render ajax request target
 During s1 some loaded LDMs could very well be invalidated by what is done
 in
 s2. The listener has no way of knowing about LDMs loaded by other
 components
 in the new page instance so it can't detach them.

 In my opinion, these are 2 problems which are very hard to solve without
 systematic detaching of models between the listener and the renderer.

 and here is a simple counter example. your form has five dropdowns,
 all of which are populated by various queries and all of which are not
 effected by the submit. now on every single submit you have to run 10
 queries instead of 5, for no good reason. the point being that right
 now we leave the room for manual eviction - allowing both usecases to
 be implemented (some models that are detached and others that are
 not). by force-detaching everything we remove the possibility to
 implement the usecase where certain models do keep their state. this
 is, imho, unacceptable.

 neither approach is perfect, but at least the current one leaves more
 doors open.

 further, in the project's lifetime this has only come up a few times,
 so obviously it is somewhat well understood and not difficult to deal
 with.

 While I don't dispute the claims about past problems, I think the new usages
 and architecture of Wicket changes things. The 2 issues I noted above are
 related to events (a new 1.5 feature, probably not used widely yet) and
 stateless ajax (still not widely used as I understand it).

 With reusable components that can be inserted in any page, components that
 update persistent state cannot determine if getPage().detach(); should be
 called; hence they have to resort to calling it systematically.

 Imagine a dashboard style stateless-ajax interface where the choice of
 components is up to the user (like in JIRA) and some components can modify
 state. These components would need to know in which context they are used to
 decide whether to call getPage().detach(); or not. Doesn't this defeat
 some of the purpose of reusable components?

 Bertrand

 -
 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



How to get a translated string for an arbitrary locale?

2011-10-28 Thread Andrew Schetinin
Hi,

I have a question about Wicket localization I could not find an answer for.

I have a component where I'd like to get a translated message for a given
key.
The actual string is sitting somewhere in a grand-parent panel, and I have
no any access to it.

I'd like to get translations for that key in more than one language (I have
a list of locale names).

It is easy to get a translation for a current locale -
component.getLocalizer().getString() would do the job. But Localizer does
not help me to get strings for other locales.
Once upon a time, there seems to be Localizer.getString() method that
accepts Locale, but as I can see now it ignores the locale parameter - the
method is deprecated in Wicket 1.4.18.

There is also ComponentStringResourceLoader that has a method that returns a
string for a given class and any locale. But the translation string I'm
looking for is sitting somewhere up the component hierarchy - I've no idea
where - so I cannot know the class name.

I'd appreciate if somebody could hint what classes and methods to look for,
and tell me if it is possible at all.

Thank you in advance,

Andrew

-- 
--
Andrew Schetinin


Re: How to get a translated string for an arbitrary locale?

2011-10-28 Thread Igor Vaynberg
Localizer#getString(final String key, final Component component, final
IModel? model, final Locale locale, final String style, final String
defaultValue)

-igor

On Fri, Oct 28, 2011 at 10:54 AM, Andrew Schetinin ascheti...@gmail.com wrote:
 Hi,

 I have a question about Wicket localization I could not find an answer for.

 I have a component where I'd like to get a translated message for a given
 key.
 The actual string is sitting somewhere in a grand-parent panel, and I have
 no any access to it.

 I'd like to get translations for that key in more than one language (I have
 a list of locale names).

 It is easy to get a translation for a current locale -
 component.getLocalizer().getString() would do the job. But Localizer does
 not help me to get strings for other locales.
 Once upon a time, there seems to be Localizer.getString() method that
 accepts Locale, but as I can see now it ignores the locale parameter - the
 method is deprecated in Wicket 1.4.18.

 There is also ComponentStringResourceLoader that has a method that returns a
 string for a given class and any locale. But the translation string I'm
 looking for is sitting somewhere up the component hierarchy - I've no idea
 where - so I cannot know the class name.

 I'd appreciate if somebody could hint what classes and methods to look for,
 and tell me if it is possible at all.

 Thank you in advance,

 Andrew

 --
 --
 Andrew Schetinin


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



Re: LDMs load too early - hold outdated application data.

2011-10-28 Thread Bertrand Guay-Paquet

On 28/10/2011 12:49 PM, Igor Vaynberg wrote:

i think you are blowing this way out of proportion.

I hope so :)

this only affects components that (A) modify their own model but do
not update it and *also* (B) have their model loaded for some reason
before they update it.
This is not the type of situation I meant. What you describe is a clear 
situation where the component doing the update can easily handle 
detaching its model for a refresh.


With a business layer and DTOs, doing the update correctly on the wicket 
model directly is impossible without replicating the business logic in 
the web client. That's why I say that the model can be detached and 
refreshed above and not just updated.


We could also argue that event handlers accessing model objects (see my 
issue 1) should systematically detach all accessed models after their 
processing to avoid stale models.


However, Issue 2 still remains. Here is a more detailed example to 
illustrate it:

class PersonDto {
private int id;
// other fields and methods
}

class ShowPersonPanel extends Panel {
private int personId;
// other fields

MyPanel (IModelPersonDto model) {
personId = model.getObject().getId(); // triggers load of LDM
// Pass model to other components + other stuff
}
}

class UpdatePersonPanel extends Panel {
// adds a component of type StatelessAjaxUpdatePersonLink
}

class StatelessAjaxUpdatePersonLink extends Link {
private IModelPersonDto personModel;

onClick(AjaxRequestTarget target) {
updateSomePersonAttribute(personModel);
personModel.detach();
target.add(this);
}
}

Consider a stateless page with a ShowPersonPanel and an 
UpdatePersonPanel. Further, when the StatelessAjaxUpdatePersonLink is 
clicked, the ShowPersonPanel is added to the request target by other code.


Sequence of events for stateless ajax request:
1-New page instance created with ShowPersonPanel and UpdatePersonPanel, 
not sharing the same IModelPersonDto instance for some reason. Note 
that the constructor of ShowPersonPanel triggers the load of its 
PersonDto LDM.
2-Ajax link listener is invoked which updates the persistent Person and 
detaches the now stale model

3-ShowPersonPanel is added to the ajax target (through events perhaps)
4-ShowPersonPanel and UpdatePersonPanel are rendered. ShowPersonPanel 
has stale LDM and UpdatePersonPanel has fresh LDM.


I don't see how to manage this without either A) a blanket detach() of 
all models or B) some complicated panel and model inter-dependency 
management.


Note that this sequence of events is not the same for stateful pages. 
The stateful pages do not construct a new page instance before invoking 
the link listener so no outside LDMs are loaded.


Regards,
Bertrand

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



Re: How to get a translated string for an arbitrary locale?

2011-10-28 Thread Andrew Schetinin
Hi Igor,

But as I said, this method is deprecated and ignores Locale parameter:

@Deprecated
public String getString(final String key, final Component component,
final IModel? model,
final Locale locale, final String style, final String defaultValue)
throws MissingResourceException
{
return getString(key, component, model, defaultValue);
}

Or am I looking in a wrong place?

Regards,

Andrew

On Fri, Oct 28, 2011 at 8:54 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 Localizer#getString(final String key, final Component component, final
 IModel? model, final Locale locale, final String style, final String
 defaultValue)

 -igor

 On Fri, Oct 28, 2011 at 10:54 AM, Andrew Schetinin ascheti...@gmail.com
 wrote:
  Hi,
 
  I have a question about Wicket localization I could not find an answer
 for.
 
  I have a component where I'd like to get a translated message for a given
  key.
  The actual string is sitting somewhere in a grand-parent panel, and I
 have
  no any access to it.
 
  I'd like to get translations for that key in more than one language (I
 have
  a list of locale names).
 
  It is easy to get a translation for a current locale -
  component.getLocalizer().getString() would do the job. But Localizer does
  not help me to get strings for other locales.
  Once upon a time, there seems to be Localizer.getString() method that
  accepts Locale, but as I can see now it ignores the locale parameter -
 the
  method is deprecated in Wicket 1.4.18.
 
  There is also ComponentStringResourceLoader that has a method that
 returns a
  string for a given class and any locale. But the translation string I'm
  looking for is sitting somewhere up the component hierarchy - I've no
 idea
  where - so I cannot know the class name.
 
  I'd appreciate if somebody could hint what classes and methods to look
 for,
  and tell me if it is possible at all.
 
  Thank you in advance,
 
  Andrew
 
  --
  --
  Andrew Schetinin
 

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




-- 
--
Andrew Schetinin


Re: LDMs load too early - hold outdated application data.

2011-10-28 Thread Igor Vaynberg
i suppose you can contrive an example that breaks any situation :)

in this case you are making a lot of assumptions: the two panels are
not sharing a model even though they are both referencing the same
person, the show panel loads the model prematurely instead of at
render time. these two things are considered bad practice anyways.

if you wanted to solves this in a neat way you can use events.
updatepersonpanel can send out a PersonUpdated event and
ShowPersonPanel can listen for it and detach its model.

-igor

On Fri, Oct 28, 2011 at 1:15 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 On 28/10/2011 12:49 PM, Igor Vaynberg wrote:

 i think you are blowing this way out of proportion.

 I hope so :)

 this only affects components that (A) modify their own model but do
 not update it and *also* (B) have their model loaded for some reason
 before they update it.

 This is not the type of situation I meant. What you describe is a clear
 situation where the component doing the update can easily handle detaching
 its model for a refresh.

 With a business layer and DTOs, doing the update correctly on the wicket
 model directly is impossible without replicating the business logic in the
 web client. That's why I say that the model can be detached and refreshed
 above and not just updated.

 We could also argue that event handlers accessing model objects (see my
 issue 1) should systematically detach all accessed models after their
 processing to avoid stale models.

 However, Issue 2 still remains. Here is a more detailed example to
 illustrate it:
 class PersonDto {
    private int id;
    // other fields and methods
 }

 class ShowPersonPanel extends Panel {
    private int personId;
    // other fields

    MyPanel (IModelPersonDto model) {
        personId = model.getObject().getId(); // triggers load of LDM
        // Pass model to other components + other stuff
    }
 }

 class UpdatePersonPanel extends Panel {
    // adds a component of type StatelessAjaxUpdatePersonLink
 }

 class StatelessAjaxUpdatePersonLink extends Link {
    private IModelPersonDto personModel;

    onClick(AjaxRequestTarget target) {
        updateSomePersonAttribute(personModel);
        personModel.detach();
        target.add(this);
    }
 }

 Consider a stateless page with a ShowPersonPanel and an UpdatePersonPanel.
 Further, when the StatelessAjaxUpdatePersonLink is clicked, the
 ShowPersonPanel is added to the request target by other code.

 Sequence of events for stateless ajax request:
 1-New page instance created with ShowPersonPanel and UpdatePersonPanel, not
 sharing the same IModelPersonDto instance for some reason. Note that the
 constructor of ShowPersonPanel triggers the load of its PersonDto LDM.
 2-Ajax link listener is invoked which updates the persistent Person and
 detaches the now stale model
 3-ShowPersonPanel is added to the ajax target (through events perhaps)
 4-ShowPersonPanel and UpdatePersonPanel are rendered. ShowPersonPanel has
 stale LDM and UpdatePersonPanel has fresh LDM.

 I don't see how to manage this without either A) a blanket detach() of all
 models or B) some complicated panel and model inter-dependency management.

 Note that this sequence of events is not the same for stateful pages. The
 stateful pages do not construct a new page instance before invoking the link
 listener so no outside LDMs are loaded.

 Regards,
 Bertrand

 -
 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



Re: How to get a translated string for an arbitrary locale?

2011-10-28 Thread Igor Vaynberg
you are right. i was looking in 1.5 where we have exposed the locale.

for the time being you can simply do this:
Locale old=session.getlocale();
session.setlocale(foo);
localizer.get(..);
session.setlocale(old);

-igor


On Fri, Oct 28, 2011 at 1:22 PM, Andrew Schetinin ascheti...@gmail.com wrote:
 Hi Igor,

 But as I said, this method is deprecated and ignores Locale parameter:

    @Deprecated
    public String getString(final String key, final Component component,
 final IModel? model,
        final Locale locale, final String style, final String defaultValue)
        throws MissingResourceException
    {
        return getString(key, component, model, defaultValue);
    }

 Or am I looking in a wrong place?

 Regards,

 Andrew

 On Fri, Oct 28, 2011 at 8:54 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 Localizer#getString(final String key, final Component component, final
 IModel? model, final Locale locale, final String style, final String
 defaultValue)

 -igor

 On Fri, Oct 28, 2011 at 10:54 AM, Andrew Schetinin ascheti...@gmail.com
 wrote:
  Hi,
 
  I have a question about Wicket localization I could not find an answer
 for.
 
  I have a component where I'd like to get a translated message for a given
  key.
  The actual string is sitting somewhere in a grand-parent panel, and I
 have
  no any access to it.
 
  I'd like to get translations for that key in more than one language (I
 have
  a list of locale names).
 
  It is easy to get a translation for a current locale -
  component.getLocalizer().getString() would do the job. But Localizer does
  not help me to get strings for other locales.
  Once upon a time, there seems to be Localizer.getString() method that
  accepts Locale, but as I can see now it ignores the locale parameter -
 the
  method is deprecated in Wicket 1.4.18.
 
  There is also ComponentStringResourceLoader that has a method that
 returns a
  string for a given class and any locale. But the translation string I'm
  looking for is sitting somewhere up the component hierarchy - I've no
 idea
  where - so I cannot know the class name.
 
  I'd appreciate if somebody could hint what classes and methods to look
 for,
  and tell me if it is possible at all.
 
  Thank you in advance,
 
  Andrew
 
  --
  --
  Andrew Schetinin
 

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




 --
 --
 Andrew Schetinin


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



Re: LDMs load too early - hold outdated application data.

2011-10-28 Thread Bertrand Guay-Paquet
Thanks for clearing that up. I didn't know it was considered bad 
practice to access _any_ model's object before rendering. In that case, 
my points are moot (but I have some code I must change...)


I wasn't only trying to build an impossible example btw :) It was pretty 
close to what I intended on doing and was wondering how to solve these 
issues when Maarten started the thread.


Cheers,
Bertrand

On 28/10/2011 4:42 PM, Igor Vaynberg wrote:

i suppose you can contrive an example that breaks any situation :)

in this case you are making a lot of assumptions: the two panels are
not sharing a model even though they are both referencing the same
person, the show panel loads the model prematurely instead of at
render time. these two things are considered bad practice anyways.

if you wanted to solves this in a neat way you can use events.
updatepersonpanel can send out a PersonUpdated event and
ShowPersonPanel can listen for it and detach its model.

-igor

On Fri, Oct 28, 2011 at 1:15 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca  wrote:

On 28/10/2011 12:49 PM, Igor Vaynberg wrote:

i think you are blowing this way out of proportion.

I hope so :)

this only affects components that (A) modify their own model but do
not update it and *also* (B) have their model loaded for some reason
before they update it.

This is not the type of situation I meant. What you describe is a clear
situation where the component doing the update can easily handle detaching
its model for a refresh.

With a business layer and DTOs, doing the update correctly on the wicket
model directly is impossible without replicating the business logic in the
web client. That's why I say that the model can be detached and refreshed
above and not just updated.

We could also argue that event handlers accessing model objects (see my
issue 1) should systematically detach all accessed models after their
processing to avoid stale models.

However, Issue 2 still remains. Here is a more detailed example to
illustrate it:
class PersonDto {
private int id;
// other fields and methods
}

class ShowPersonPanel extends Panel {
private int personId;
// other fields

MyPanel (IModelPersonDto  model) {
personId = model.getObject().getId(); // triggers load of LDM
// Pass model to other components + other stuff
}
}

class UpdatePersonPanel extends Panel {
// adds a component of type StatelessAjaxUpdatePersonLink
}

class StatelessAjaxUpdatePersonLink extends Link {
private IModelPersonDto  personModel;

onClick(AjaxRequestTarget target) {
updateSomePersonAttribute(personModel);
personModel.detach();
target.add(this);
}
}

Consider a stateless page with a ShowPersonPanel and an UpdatePersonPanel.
Further, when the StatelessAjaxUpdatePersonLink is clicked, the
ShowPersonPanel is added to the request target by other code.

Sequence of events for stateless ajax request:
1-New page instance created with ShowPersonPanel and UpdatePersonPanel, not
sharing the same IModelPersonDto  instance for some reason. Note that the
constructor of ShowPersonPanel triggers the load of its PersonDto LDM.
2-Ajax link listener is invoked which updates the persistent Person and
detaches the now stale model
3-ShowPersonPanel is added to the ajax target (through events perhaps)
4-ShowPersonPanel and UpdatePersonPanel are rendered. ShowPersonPanel has
stale LDM and UpdatePersonPanel has fresh LDM.

I don't see how to manage this without either A) a blanket detach() of all
models or B) some complicated panel and model inter-dependency management.

Note that this sequence of events is not the same for stateful pages. The
stateful pages do not construct a new page instance before invoking the link
listener so no outside LDMs are loaded.

Regards,
Bertrand

-
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
For additional commands, e-mail: users-h...@wicket.apache.org



Can an AJAX event navigate to a page using a BookmarkablePageLink

2011-10-28 Thread Chris Colman
Are BookmarkablePageLinks only for use with a href=# tags use or is it
possible to catch an AJAX event and use the BookmarkablePageLink as the
'destination specifier' for the navigation or does navigation under AJAX
always have to be via setReponsePage()?
 
Chris


Re: Can an AJAX event navigate to a page using a BookmarkablePageLink

2011-10-28 Thread Igor Vaynberg
setResonsePage(class, params) should still work

also if you have a bpl you can do something like
target.appendjavascript(window.location='+bpl.geturl()+';);

-igor


On Fri, Oct 28, 2011 at 2:51 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 Are BookmarkablePageLinks only for use with a href=# tags use or is it
 possible to catch an AJAX event and use the BookmarkablePageLink as the
 'destination specifier' for the navigation or does navigation under AJAX
 always have to be via setReponsePage()?

 Chris


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



RE: Can an AJAX event navigate to a page using a BookmarkablePageLink

2011-10-28 Thread Chris Colman
BookmarkablePageLink

setResonsePage(class, params) should still work

also if you have a bpl you can do something like
target.appendjavascript(window.location='+bpl.geturl()+';);

Ah! That's exactly what I was looking for. I already have a bpl
available so I was trying to leverage the data I had already built up in
that rather than construct a PageParameters with all the required
parameters.


-igor


On Fri, Oct 28, 2011 at 2:51 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 Are BookmarkablePageLinks only for use with a href=# tags use or is
it
 possible to catch an AJAX event and use the BookmarkablePageLink as
the
 'destination specifier' for the navigation or does navigation under
AJAX
 always have to be via setReponsePage()?

 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