Re: Regarding Browser/Client info implementation

2015-12-24 Thread Rakesh A
I created JIRA ticket - https://issues.apache.org/jira/browse/WICKET-6056

PR links for master and wicket-6.x branches, are added at ticket comments
section.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Regarding-Browser-Client-info-implementation-tp4673024p4673093.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: programmatic resources lookup

2015-12-24 Thread Garret Wilson

On 12/24/2015 9:39 AM, Garret Wilson wrote:
... The use of StringResourceModel as you provided almost solved my 
problem, but not quite. When calling from MyPage.java, I had to add 
"this" to the constructor in order for it to pick up resources in the 
MyPage.properties files.


P.S. It's a shame there's no way to do the lookup from a static context, 
e.g. my passing a reference to MyPage.class rather than an actual 
instance of MyPage. But I'll get by. Thanks again for the help.


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



Re: programmatic resources lookup

2015-12-24 Thread Garret Wilson
Sven (and Martin, who provided a similar but less complete answer), I'd 
rather not use ${} because in our properties files (for other parts of 
the application unrelated to Wicket) we use ${...} to refer to other 
string resources.


The use of StringResourceModel as you provided almost solved my problem, 
but not quite. When calling from MyPage.java, I had to add "this" to the 
constructor in order for it to pick up resources in the 
MyPage.properties files. But then it worked---thanks!


Garret

On 12/24/2015 2:44 AM, Sven Meier wrote:

Hi,

the easiest solution would be not to use MessageFormat:

getSession().success(getString("success.message", Model.of(fooBar)));

with:

success.message=Successfully munged the ${}.

If you insist on using MessageFormat, you can just use 
StringResourceModel for that:


getSession().success(new 
StringResourceModel("success.message").setParameters(fooBar).getString());


Have fun
Sven


On 24.12.2015 01:11, Garret Wilson wrote:
I've been away from Wicket for a year, working on other areas of my 
client's code. I'm doing a pass by to add i18n to a page. I have a 
MyPage.properties file with all sorts of properties. I have lots of 
 tags in MyPage.html.


But how do I manually look up one of these values from the resources? 
For example, in MyPage.onAccept() I have something like this:


getSession().success("Successfully munged the " + fooBar + ".");

I want to look up the value from MyPage.properties:

success.message=Successfully munged the {0}.

Looking at the source code of StringResourceModel, it seems I'll have 
to do the following:


1. Get a localizer.
2. Ask the localizer to get the resource string.
3. Escape single quotes.
4. Escape substitution expressions (e.g. ${some.other.property}).
5. Use MessageFormat to substitute the parameters (e.g. fooBar, above).
6. Unescape the substitution expression.
7. Ask the localizer to perform substitution for all the expressions.


Whew! I'm exhausted just writing that. Surely there is a utility 
method that would do that for me?


Garret

P.S. A /single/ method. There should be a single method for this.





-
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: Regarding Browser/Client info implementation

2015-12-24 Thread Rakesh A
Done - https://github.com/apache/wicket/pull/152

Mary Christmas :)

Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Regarding-Browser-Client-info-implementation-tp4673024p4673083.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: Regarding Browser/Client info implementation

2015-12-24 Thread Tobias Soloschenko

Please create a PR so that code lines can be discussed with inline comments.

Thanks!

Merry Christmas :-)

Am 24.12.15 um 11:00 schrieb Rakesh A:

Can you go through this check-in
https://github.com/iamrakesh/wicket/commit/351f084872467f0d3d0f339ab9c20afb4f79d2d1

Or do you need PR?

Regards,
Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Regarding-Browser-Client-info-implementation-tp4673024p4673070.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




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



Re: Regarding Browser/Client info implementation

2015-12-24 Thread Martin Grigorov
Hi,

The change looks good.
I see some minor improvements which we can make.
Please create a ticket in JIRA!
A PR will help to integrate it sooner!
Thank you!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 24, 2015 at 11:00 AM, Rakesh A 
wrote:

> Can you go through this check-in
>
> https://github.com/iamrakesh/wicket/commit/351f084872467f0d3d0f339ab9c20afb4f79d2d1
>
> Or do you need PR?
>
> Regards,
> Rakesh.A
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Regarding-Browser-Client-info-implementation-tp4673024p4673070.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: Bug in wicket-jqueryui Kendo DateTimePicker?

2015-12-24 Thread Sebastien
Hi Hans,

Lol, completely forgot this !
I am not really able to help today. Please check the forum and github
issues, you should find some answers about this...

If it still not helps, please create a quickstart and will have a look
early next week.

Merry Christmas,
Sebastien
On Dec 24, 2015 12:27, "hfriederichs"  wrote:

> Hello Sebastien,
>
> It's the day of the week.
> SimpleDateFormat's javadoc:
>
>
> Date and TimePattern Result
> "EEE, MMM d, ''yy"  Wed, Jul 4, '01
>
>
> Hans
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Bug-in-wicket-jqueryui-Kendo-DateTimePicker-tp4673069p4673072.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: Bug in wicket-jqueryui Kendo DateTimePicker?

2015-12-24 Thread hfriederichs
Hello Sebastien,

It's the day of the week.
SimpleDateFormat's javadoc:


Date and TimePattern Result 
"EEE, MMM d, ''yy"  Wed, Jul 4, '01  


Hans

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Bug-in-wicket-jqueryui-Kendo-DateTimePicker-tp4673069p4673072.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: Bug in wicket-jqueryui Kendo DateTimePicker?

2015-12-24 Thread Sebastien
Hi,

What EEE stands for ?

Java date patterns and kendo ui date patterns are very close, so a valid
java pattern should make it work. Additionnally, you can use the culture
option, please look at the samples...

Hope this helps,
Sebastien


Re: Regarding Browser/Client info implementation

2015-12-24 Thread Rakesh A
Can you go through this check-in
https://github.com/iamrakesh/wicket/commit/351f084872467f0d3d0f339ab9c20afb4f79d2d1

Or do you need PR?

Regards,
Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Regarding-Browser-Client-info-implementation-tp4673024p4673070.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



Bug in wicket-jqueryui Kendo DateTimePicker?

2015-12-24 Thread hfriederichs
Hello,

I'm using wicket-jquery-ui version 6.21.0. (and Wicket 6.20.0)
I'm adding a
com.googlecode.wicket.kendo.ui.form.datetime.AjaxDateTimePicker:

private final static String dateDisplay = "EEE d MMM ";
private final static String timeDisplay = "HH.mm";

DateTimePicker scheduleDateTimeField = new
AjaxDateTimePicker("planDateTime", planDateModel, dateDisplay, timeDisplay)
{
... etcetera

At first page rendering, the displayed Date is as it should be: 'do 24 dec
2015' ('do' is short for thursday in the Dutch Locale)

However, after selecting another Date in the picker, it shows: EEE 25 dec
2015, and the right rendering never appears again.

A bug or am I doing something wrong?

Regards, Hans Friederichs


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Bug-in-wicket-jqueryui-Kendo-DateTimePicker-tp4673069.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: programmatic resources lookup

2015-12-24 Thread Sven Meier

Hi,

the easiest solution would be not to use MessageFormat:

getSession().success(getString("success.message", Model.of(fooBar)));

with:

success.message=Successfully munged the ${}.

If you insist on using MessageFormat, you can just use 
StringResourceModel for that:


getSession().success(new 
StringResourceModel("success.message").setParameters(fooBar).getString());


Have fun
Sven


On 24.12.2015 01:11, Garret Wilson wrote:
I've been away from Wicket for a year, working on other areas of my 
client's code. I'm doing a pass by to add i18n to a page. I have a 
MyPage.properties file with all sorts of properties. I have lots of 
 tags in MyPage.html.


But how do I manually look up one of these values from the resources? 
For example, in MyPage.onAccept() I have something like this:


getSession().success("Successfully munged the " + fooBar + ".");

I want to look up the value from MyPage.properties:

success.message=Successfully munged the {0}.

Looking at the source code of StringResourceModel, it seems I'll have 
to do the following:


1. Get a localizer.
2. Ask the localizer to get the resource string.
3. Escape single quotes.
4. Escape substitution expressions (e.g. ${some.other.property}).
5. Use MessageFormat to substitute the parameters (e.g. fooBar, above).
6. Unescape the substitution expression.
7. Ask the localizer to perform substitution for all the expressions.


Whew! I'm exhausted just writing that. Surely there is a utility 
method that would do that for me?


Garret

P.S. A /single/ method. There should be a single method for this.





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