That's only question of time, Johan hasn't yet had time to generify pages.
-Matej
On Fri, Apr 11, 2008 at 3:10 AM, Jonathan Locke
<[EMAIL PROTECTED]> wrote:
>
>
> uh, i meant WebPage obviously
>
>
>
>
> Jonathan Locke wrote:
> >
> >
> > i didn't say it shouldn't be. i was just saying /if it was not going to
> > be/ (i'm not working on 1.4 yet, so i don't know why it's not generic
> > already) it shouldn't create generics warnings. in fact, i agree with you
> > and people should ideally just say MyPage extends WebPage<?> if their page
> > has no model.
> >
> >
> > igor.vaynberg wrote:
> >>
> >> why wouldnt page be generic?
> >>
> >> class edituserpage extends webpage<user> {
> >> public edituserpage(imodel<user> user) {...}}
> >>
> >> -igor
> >>
> >>
> >> On Thu, Apr 10, 2008 at 5:22 PM, Jonathan Locke
> >> <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>> yeah. if Page/WebPage are not going to be generic, maybe they should
> >>> extend
> >>> (Web)MarkupContainer<?> or something?
> >>>
> >>>
> >>> MYoung wrote:
> >>> >
> >>> >> public class HomePage extends WebPage {
> >>>
> >>> >
> >>> > ERROR: The type WebPage is not generic; it cannot be parameterized
> >>> with
> >>> > arguments
> >>> >
> >>> >
> >>> >
> >>>
> >>> >>you COULD use the @SuppressWarnings({"unchecked"})
> >>> >
> >>> > I would rather not use @SupressWarnings if I can do the right thing.
> >>> >
> >>> > On Thu, Apr 10, 2008 at 4:49 PM, Matej Knopp <[EMAIL PROTECTED]>
> >>> > wrote:
> >>> >
> >>> >> Problem is that WebPage is generic class but your instance doesn't
> >>> >> have the type specified. Since you page doesn't have a model object
> >>> >> the type is not really necessary, but the compiler doesn't know
> >>> that.
> >>> >>
> >>> >> You can try this:
> >>> >>
> >>> >>
> >>> >> public class HomePage extends WebPage {
> >>>
> >>>
> >>> >>
> >>> >> This should get rid of the wanings when adding components.
> >>> >>
> >>> >> -Matej
> >>> >>
> >>> >> On Fri, Apr 11, 2008 at 1:19 AM, Matthew Young <[EMAIL PROTECTED]>
> >>> wrote:
> >>> >> > Oh mine, some many generic warnings after moving to 1.4. I got
> >>> rid of
> >>> >> them
> >>> >> > by putting in type parameters but I'm not sure if I'm doing the
> >>> right
> >>> >> thing.
> >>> >> > There is one warning I don't know how to fix:
> >>> >> >
> >>> >> > WARNING: Type safety: the method add(Component) belongs to the
> >>> raw
> >>> >> type
> >>> >> > MarkupContainer. Reference to generic type MarkupContainer<T>
> >>> should
> >>> >> be
> >>> >> > parameterized.
> >>> >> >
> >>> >> >
> >>> >> > What are the benefits of generifying Wicket? I only know one is
> >>> type
> >>> >> safe
> >>> >> > model. What else?
> >>> >> >
> >>> >> >
> >>> >> >
> >>> >> > Here is a little test page, please take a look and see if I'm
> >>> doing
> >>> >> thing
> >>> >> > correctly?
> >>> >> >
> >>> >> > public class HomePage extends WebPage {
> >>> >> >
> >>> >> > private static final long serialVersionUID = 1L;
> >>> >> >
> >>> >> > private String hi ="";
> >>> >> > private int count;
> >>> >> >
> >>> >> > public HomePage(final PageParameters parameters) {
> >>> >> >
> >>> >> > // WARNING HERE and next line
> >>> >> > add(new Label<HomePage>("message", "If you see this
> >>> message
> >>> >> wicket
> >>> >> > is properly configured and running"));
> >>> >> > add(new FeedbackPanel("feedback"));
> >>> >> > Form<HomePage> form = new Form<HomePage>("form", new
> >>> >> > CompoundPropertyModel<HomePage>(this)) {
> >>> >> > private static final long serialVersionUID = 1L;
> >>> >> > @Override public void onSubmit() {
> >>> >> > ++count;
> >>> >> > }
> >>> >> > };
> >>> >> > add(form); // WARNING HERE
> >>> >> > form.add(new TextField<HomePage>("hi").setRequired(true));
> >>> >> > // WARNING HERE
> >>> >> > add(new Label<HomePage>("hihi", new
> >>> >> PropertyModel<HomePage>(this,
> >>> >> > "hello")));
> >>> >> > }
> >>> >> >
> >>> >> > public String getHello() {
> >>> >> > return hi + ": you say hello " + count + " times.";
> >>> >> > }
> >>> >> > }
> >>> >> >
> >>> >>
> >>> >>
> >>> >>
> >>> >> --
> >>> >> Resizable and reorderable grid components.
> >>> >> http://www.inmethod.com
> >>> >>
> >>> >>
> >>> ---------------------------------------------------------------------
> >>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>> >>
> >>> >>
> >>> >
> >>> >
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/Migrating-to-1.4-SNAPSHOT%3A-how-to-rid-of-generic-warnings--tp16622159p16622850.html
> >>> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>>
> >>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Migrating-to-1.4-SNAPSHOT%3A-how-to-rid-of-generic-warnings--tp16622159p16623297.html
>
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Resizable and reorderable grid components.
http://www.inmethod.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]