Well, a couple of strings more or less usually don't make that much of a
difference. I personally prefer to save some typing and have better
readability then to save a few bytes here and there.

Furthermore, if you were to create an implementation of IModel specifically
for this case, you would always need to store the string as an instance
variable, thus creating the "problem" you are trying to solve.


Serban Balamaci wrote:
> 
> Hello.
> I've always used
> add(new Label("alabel", new Model("A message")); - does this not save the
> "A message" string in the page store?
> Is it not better to do add(new Label("alabel", new
> LoadableDetachableModel<String>() {
> 
>             @Override
>             protected String load() {
>                 return "A message";
>             }
>         })); - while this option does not save it in the page store.
> Is it because of the coding amount that nobody is using this? I guess not
> because we could extend IModel and create a "label model" with a string
> property that is cleared on detach.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Model-to-use-for-static-Label-text-tp27695054p27695195.html
Sent from the Wicket - User 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

Reply via email to