What we want is a generic model. IModel<List<Person>> etc.

Eelco


On 2/10/06, VGJ <[EMAIL PROTECTED]> wrote:
> You'll have to forgive my ignorance as I've only been using Java for about a
> year, but - why can't generics be used?  Wouldn't you still be able to use a
> List without supplying a type (i.e. new ArrayList() vs. new
> ArrayList<MyClass>()) - thus making it backward-compatible?  I've only
> really gotten serious about java since 5.0, so I'm sure I'm missing
> something obvious. I just know that I've been able to use non-generic
> collections while using JDK 5.0.
>
> It'd be nice to see Wicket go 5.0 soon as JDK 6.0 is quickly coming to
> fruition.  I know the ususal response to that is "vendors aren't as quick to
> adopt a new JDK" but I would think that would accelerate a little now that
> JDK releases aren't so slow to be released these days (probably to compete
> w/ .NET and others.)
>
>
> On 2/10/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > There are, but it is undecided yet. It won't happen for 1.x, because
> > we want to support all the people that are using Wicket now with JDK
> > 1.4. For 2.0 that might be another question, which still has to be
> > decided upon - but which at least has a few proponents, including
> > yours truely.
> >
> > Eelco
> >
> >
> > On 2/10/06, Mats Norén <[EMAIL PROTECTED]> wrote:
> > > Are there any thoughts about using generics?
> > >
> > > On 2/10/06, Eelco Hillenius < [EMAIL PROTECTED]> wrote:
> > > > Yep, that's it. Instead of passing your domain object directly, you
> > > > might consider putting it behind a IModel instance:
> > > >
> > > > public class HeaderPanel extends Panel
> > > > {
> > > >        public HeaderPanel(String id, IModel blog)
> > > >        {
> > > >                super(id);
> > > >
> > > >                add(new Label("name", new PropertyModel(blog, "name"));
> > > >                add(new Label("synopsis", new PropertyModel(blog,
> "synopsis"));
> > > >        }
> > > > }
> > > >
> > > > or
> > > >
> > > > public class HeaderPanel extends Panel
> > > > {
> > > >        public HeaderPanel(String id, IModel blog)
> > > >        {
> > > >                super(id, new CompoundPropertyModel(blog));
> > > >
> > > >                add(new Label("name"));
> > > >                add(new Label("synopsis"));
> > > >        }
> > > > }
> > > >
> > > > Pro for using IModel instead of domain object: you can later decide to
> > > > use detachable models, which is usually a good idea when you use
> > > > Hibernate (otherwise you'll end up with stale Session references in
> > > > your objects) and which will use less session memory.
> > > >
> > > > Con: it's more work, makes the code harder to follow, you have to do
> > > > refactorings of properties by hand and less efficient if memory is not
> > > > a problem.
> > > >
> > > > Oooh, I whish we could use generics for the core project so that the
> > > > first few cons were eliminated.
> > > >
> > > > Eelco
> > > >
> > > >
> > > > On 2/10/06, V. Jenks <[EMAIL PROTECTED]> wrote:
> > > > > I'm having a little trouble understanding how to use Panels
> correctly.
> > > > >
> > > > > I'm trying to convert a JSP that has many JSP 2.0 tagfile "includes"
> of
> > > > > which I pass objects into so they can display some of the data that
> the
> > > > > "master" JSP tag displays.
> > > > >
> > > > > In Wicket, I've re-created the tagfiles as Panels and I'm trying to
> pass
> > > > > data to them from the "master" page class through the Panels'
> > > > > constructors..like so:
> > > > >
> > > > > public class HeaderPanel extends Panel
> > > > > {
> > > > >         public HeaderPanel(String id, Blog blog)
> > > > >         {
> > > > >                 super(id);
> > > > >
> > > > >                 add(new Label("name", blog.getName()));
> > > > >                 add(new Label("synopsis", blog.getSynopsis()));
> > > > >         }
> > > > > }
> > > > >
> > > > > I'm guessing that this is the way to do this as I haven't been able
> to
> > > > > find any examples stating otherwise.
> > > > >
> > > > > Am I on the right track?  Maybe the wiki could use a JSP-to-Wicket
> > > > > upgrade path type of document?
> > > > >
> > > > > Thanks!
> > > > >
> > > > >
> > > > >
> > > > >
> -------------------------------------------------------
> > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through
> log files
> > > > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> SPLUNK!
> > > > >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> > > > > _______________________________________________
> > > > > Wicket-user mailing list
> > > > > [email protected]
> > > > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > >
> > > >
> > > >
> > > >
> -------------------------------------------------------
> > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> > > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> SPLUNK!
> > > >
> http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
> > > > _______________________________________________
> > > > Wicket-user mailing list
> > > > [email protected]
> > > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> > >
> http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
> > > _______________________________________________
> > > Wicket-user mailing list
> > > [email protected]
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> > for problems?  Stop!  Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> >
> http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to