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<Object> {
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]