You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Fernando Wermus <fe...@gmail.com> on 2009/09/13 23:57:52 UTC

ResourceModel and Collection

Hi all,
    I would like to get a collection of string insted of a string using
ResourceModel. Is this achievable? Or which would be the best aproach?

I have to publish in the simplest way just 2 or 3 news on the homepage of
the site.....

thanks in advance

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus

Re: ResourceModel and Collection

Posted by Fernando Wermus <fe...@gmail.com>.
I am talking to give a key to ResourceModel and get a Collection of strings.

On Mon, Sep 14, 2009 at 4:18 PM, Pedro Santos <pe...@gmail.com> wrote:

> If you are talking about collection as an object that implements from
> Collection interface, no. The ResourceModel only take a String value from
> application localizer, using an key. It do not deserialize an object, like
> a
> collection previously written...
>
> On Mon, Sep 14, 2009 at 11:10 AM, Fernando Wermus <
> fernando.wermus@gmail.com
> > wrote:
>
> > Pedro,    What I want is not to persist this data into a database, but to
> > have in a property file. Could I have a collection in a property file and
> > access to it through some model, for instance ResourceModel? Or I have to
> > do
> > a lot of hard work using my db?
> >
> > Thanks in advance
> >
> > On Mon, Sep 14, 2009 at 8:46 AM, Pedro Santos <pe...@gmail.com>
> wrote:
> >
> > > Hi,
> > > the best approach depends on your project. If the your collections of
> > > strings is an bean property, you can use PropertyModel,
> > > CompoundPropertyModel
> > > ex: new PropertyModel<Collection>(beanDayNews, "sportNews");
> > >
> > > Depending on your model data heavy, you can use LoadableDetachableModel
> > or
> > > Model...
> > >
> > >
> >
> http://wicket.apache.org/docs/1.4/org/apache/wicket/model/package-tree.html
> > >
> > > On Sun, Sep 13, 2009 at 6:57 PM, Fernando Wermus
> > > <fe...@gmail.com>wrote:
> > >
> > > > Hi all,
> > > >    I would like to get a collection of string insted of a string
> using
> > > > ResourceModel. Is this achievable? Or which would be the best
> aproach?
> > > >
> > > > I have to publish in the simplest way just 2 or 3 news on the
> homepage
> > of
> > > > the site.....
> > > >
> > > > thanks in advance
> > > >
> > > > --
> > > > Fernando Wermus.
> > > >
> > > > www.linkedin.com/in/fernandowermus
> > > >
> > >
> >
> >
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
> >
>



-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus

Re: ResourceModel and Collection

Posted by Pedro Santos <pe...@gmail.com>.
If you are talking about collection as an object that implements from
Collection interface, no. The ResourceModel only take a String value from
application localizer, using an key. It do not deserialize an object, like a
collection previously written...

On Mon, Sep 14, 2009 at 11:10 AM, Fernando Wermus <fernando.wermus@gmail.com
> wrote:

> Pedro,    What I want is not to persist this data into a database, but to
> have in a property file. Could I have a collection in a property file and
> access to it through some model, for instance ResourceModel? Or I have to
> do
> a lot of hard work using my db?
>
> Thanks in advance
>
> On Mon, Sep 14, 2009 at 8:46 AM, Pedro Santos <pe...@gmail.com> wrote:
>
> > Hi,
> > the best approach depends on your project. If the your collections of
> > strings is an bean property, you can use PropertyModel,
> > CompoundPropertyModel
> > ex: new PropertyModel<Collection>(beanDayNews, "sportNews");
> >
> > Depending on your model data heavy, you can use LoadableDetachableModel
> or
> > Model...
> >
> >
> http://wicket.apache.org/docs/1.4/org/apache/wicket/model/package-tree.html
> >
> > On Sun, Sep 13, 2009 at 6:57 PM, Fernando Wermus
> > <fe...@gmail.com>wrote:
> >
> > > Hi all,
> > >    I would like to get a collection of string insted of a string using
> > > ResourceModel. Is this achievable? Or which would be the best aproach?
> > >
> > > I have to publish in the simplest way just 2 or 3 news on the homepage
> of
> > > the site.....
> > >
> > > thanks in advance
> > >
> > > --
> > > Fernando Wermus.
> > >
> > > www.linkedin.com/in/fernandowermus
> > >
> >
>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>

Re: ResourceModel and Collection

Posted by Fernando Wermus <fe...@gmail.com>.
Pedro,    What I want is not to persist this data into a database, but to
have in a property file. Could I have a collection in a property file and
access to it through some model, for instance ResourceModel? Or I have to do
a lot of hard work using my db?

Thanks in advance

On Mon, Sep 14, 2009 at 8:46 AM, Pedro Santos <pe...@gmail.com> wrote:

> Hi,
> the best approach depends on your project. If the your collections of
> strings is an bean property, you can use PropertyModel,
> CompoundPropertyModel
> ex: new PropertyModel<Collection>(beanDayNews, "sportNews");
>
> Depending on your model data heavy, you can use LoadableDetachableModel or
> Model...
>
> http://wicket.apache.org/docs/1.4/org/apache/wicket/model/package-tree.html
>
> On Sun, Sep 13, 2009 at 6:57 PM, Fernando Wermus
> <fe...@gmail.com>wrote:
>
> > Hi all,
> >    I would like to get a collection of string insted of a string using
> > ResourceModel. Is this achievable? Or which would be the best aproach?
> >
> > I have to publish in the simplest way just 2 or 3 news on the homepage of
> > the site.....
> >
> > thanks in advance
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
> >
>



-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus

Re: ResourceModel and Collection

Posted by Pedro Santos <pe...@gmail.com>.
Hi,
the best approach depends on your project. If the your collections of
strings is an bean property, you can use PropertyModel,
CompoundPropertyModel
ex: new PropertyModel<Collection>(beanDayNews, "sportNews");

Depending on your model data heavy, you can use LoadableDetachableModel or
Model...

http://wicket.apache.org/docs/1.4/org/apache/wicket/model/package-tree.html

On Sun, Sep 13, 2009 at 6:57 PM, Fernando Wermus
<fe...@gmail.com>wrote:

> Hi all,
>    I would like to get a collection of string insted of a string using
> ResourceModel. Is this achievable? Or which would be the best aproach?
>
> I have to publish in the simplest way just 2 or 3 news on the homepage of
> the site.....
>
> thanks in advance
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>