You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pixologe <pi...@mailinator.com> on 2008/08/27 11:59:42 UTC

StringResourceModel: use MessageFormat features without params array?

Hello mailing list,

Short question: if my interpretation of the source code is correct, it is
not possible to use StringResourceModel's MessageFormat features just with a
single model (without passing a params array).

If this is right: would it be a good idea to make it possible or is there a
good reason that it is not, which I am not aware of?

What I do not like about the Array way is that the message in the property
file has not only to be aware of what was passed in this Array, but also in
which order, which is not very flexible.

WDYT?

I have an idea in mind how this could be achieved and also would like to
contribute... however, as I am not too deep into the wicket internals, I
cannot promise my solution would be the most elegant one ;-)

Cheers


-- 
View this message in context: http://www.nabble.com/StringResourceModel%3A-use-MessageFormat-features-without-params-array--tp19177943p19177943.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: StringResourceModel: use MessageFormat features without params array?

Posted by pixologe <pi...@mailinator.com>.
Ooops sorry, did not think there would be any reply after a few days...

Implementing the varargs doesn't make this any nicer, I think. (Well, a
little bit...)
The current way does not seem very elegant to me, why would one want to pass
an array of propertymodels as a 4th param if all the data could be passed
using a single model in the 3rd param? It just does not look right in the
line of how elegant the very same works when there are no MessageFormat
features needed.

I will have a look at it when there's time... maybe I'll be able to post an
actual suggestion for improvement then, otherweise I will understand why it
is implemented as it currently is. ;-)



Timo Rantalaiho wrote:
> 
> On Wed, 27 Aug 2008, pixologe wrote:
>> Short question: if my interpretation of the source code is correct, it is
>> not possible to use StringResourceModel's MessageFormat features just
>> with a
>> single model (without passing a params array).
>> 
>> If this is right: would it be a good idea to make it possible or is there
>> a
>> good reason that it is not, which I am not aware of?
> 
> I think that the best choice is to fix that with varargs in 
> Wicket 1.4 or 1.5 (that use Java 5 that has varargs). The 
> dependency on the order will stay though.
> 
> Best wishes,
> Timo
> 
> -- 
> Timo Rantalaiho           
> Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/StringResourceModel%3A-use-MessageFormat-features-without-params-array--tp19177943p19391213.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: StringResourceModel: use MessageFormat features without params array?

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Wed, 27 Aug 2008, pixologe wrote:
> Short question: if my interpretation of the source code is correct, it is
> not possible to use StringResourceModel's MessageFormat features just with a
> single model (without passing a params array).
> 
> If this is right: would it be a good idea to make it possible or is there a
> good reason that it is not, which I am not aware of?

I think that the best choice is to fix that with varargs in 
Wicket 1.4 or 1.5 (that use Java 5 that has varargs). The 
dependency on the order will stay though.

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

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