Unknown tag name with Wicket namespace: 'panel'

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Unknown tag name with Wicket namespace: 'panel'

Andy Van Den Heuvel
I get an exception and it's not very clear to me what I'm doing wrong.

This is the exception:
Last cause: Unknown tag name with Wicket namespace: 'panel'. Might be you
haven't installed the appropriate resolver? '<wicket:panel>' (line 3,
column 2)

I'm trying to override the markupSourcingStrategy because i want this class
to have it's own html file. Anybody an idea? I use wicket-core 6.7.0.


This is my java file:
public class ExtBookMarkablePageLink<T> extends BookmarkablePageLink<T> {

private final Component label;
 public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
pageClass) {
this(id, pageClass, new PageParameters());
}
 public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
pageClass, final PageParameters parameters) {
super(id, pageClass, parameters);
add(label = newLabel("label"));
}
    protected Component newLabel(final String markupId) {
        return new Label(markupId, new
Model<String>("")).setRenderBodyOnly(true);
    }

@Override
protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
return new PanelMarkupSourcingStrategy(true);
}

    public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
        this.label.setDefaultModel(label);
        return this;
    }

}

and this my html file:
<!doctype html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
  <span wicket:id="label"></span>
  </wicket:panel>
</html>
Reply | Threaded
Open this post in threaded view
|

RE: Unknown tag name with Wicket namespace: 'panel'

Paul Bors
Get rid of your newMarkupSourcingStrategy() override and place the HTML
right next to the Java source code and you'll be fine.

If you do not like the default location of the HTML next to your Java
classes, then read Chapter 4 of the Wicket user guide you can get for free
from wicket's website at:
http://wicket.apache.org/learn/books/

~ Thank you,
  Paul Bors

-----Original Message-----
From: Andy Van Den Heuvel [mailto:[hidden email]]
Sent: Monday, May 13, 2013 2:04 PM
To: [hidden email]
Subject: Unknown tag name with Wicket namespace: 'panel'

I get an exception and it's not very clear to me what I'm doing wrong.

This is the exception:
Last cause: Unknown tag name with Wicket namespace: 'panel'. Might be you
haven't installed the appropriate resolver? '<wicket:panel>' (line 3, column
2)

I'm trying to override the markupSourcingStrategy because i want this class
to have it's own html file. Anybody an idea? I use wicket-core 6.7.0.


This is my java file:
public class ExtBookMarkablePageLink<T> extends BookmarkablePageLink<T> {

private final Component label;
 public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
pageClass) {
this(id, pageClass, new PageParameters()); }  public <C extends Page>
ExtBookMarkablePageLink(String id, Class<C> pageClass, final PageParameters
parameters) { super(id, pageClass, parameters); add(label =
newLabel("label")); }
    protected Component newLabel(final String markupId) {
        return new Label(markupId, new
Model<String>("")).setRenderBodyOnly(true);
    }

@Override
protected IMarkupSourcingStrategy newMarkupSourcingStrategy() { return new
PanelMarkupSourcingStrategy(true);
}

    public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
        this.label.setDefaultModel(label);
        return this;
    }

}

and this my html file:
<!doctype html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
  <span wicket:id="label"></span>
  </wicket:panel>
</html>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

~ Thank you,
    Paul@Bors.ws
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

Martin Grigorov-4
Hi,


On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]> wrote:

> Get rid of your newMarkupSourcingStrategy() override and place the HTML
> right next to the Java source code and you'll be fine.
>

This will not work because usually Link component has no its own markup
file.

See Panel.java. It has:

static
{
// register "wicket:panel"
 WicketTagIdentifier.registerWellKnownTagName(PANEL);
}

Just add this to your class and it should work.

I think this is a bug in Wicket though - this piece of code should be
executed by PanelMarkupSourcingStrategy, not by Panel itself.

Feel free to file a bug report.


>
> If you do not like the default location of the HTML next to your Java
> classes, then read Chapter 4 of the Wicket user guide you can get for free
> from wicket's website at:
> http://wicket.apache.org/learn/books/
>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Andy Van Den Heuvel [mailto:[hidden email]]
> Sent: Monday, May 13, 2013 2:04 PM
> To: [hidden email]
> Subject: Unknown tag name with Wicket namespace: 'panel'
>
> I get an exception and it's not very clear to me what I'm doing wrong.
>
> This is the exception:
> Last cause: Unknown tag name with Wicket namespace: 'panel'. Might be you
> haven't installed the appropriate resolver? '<wicket:panel>' (line 3,
> column
> 2)
>
> I'm trying to override the markupSourcingStrategy because i want this class
> to have it's own html file. Anybody an idea? I use wicket-core 6.7.0.
>
>
> This is my java file:
> public class ExtBookMarkablePageLink<T> extends BookmarkablePageLink<T> {
>
> private final Component label;
>  public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
> pageClass) {
> this(id, pageClass, new PageParameters()); }  public <C extends Page>
> ExtBookMarkablePageLink(String id, Class<C> pageClass, final PageParameters
> parameters) { super(id, pageClass, parameters); add(label =
> newLabel("label")); }
>     protected Component newLabel(final String markupId) {
>         return new Label(markupId, new
> Model<String>("")).setRenderBodyOnly(true);
>     }
>
> @Override
> protected IMarkupSourcingStrategy newMarkupSourcingStrategy() { return new
> PanelMarkupSourcingStrategy(true);
> }
>
>     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
>         this.label.setDefaultModel(label);
>         return this;
>     }
>
> }
>
> and this my html file:
> <!doctype html>
> <html xmlns:wicket="http://wicket.apache.org">
> <wicket:panel>
>   <span wicket:id="label"></span>
>   </wicket:panel>
> </html>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

vineetsemwal
In reply to this post by Andy Van Den Heuvel
see link#setbody(model) ,i think this is what you are trying to do :-)
else that should be  PanelMarkupSourcingStrategy(*false*)


On Mon, May 13, 2013 at 11:33 PM, Andy Van Den Heuvel <
[hidden email]> wrote:

> I get an exception and it's not very clear to me what I'm doing wrong.
>
> This is the exception:
> Last cause: Unknown tag name with Wicket namespace: 'panel'. Might be you
> haven't installed the appropriate resolver? '<wicket:panel>' (line 3,
> column 2)
>
> I'm trying to override the markupSourcingStrategy because i want this class
> to have it's own html file. Anybody an idea? I use wicket-core 6.7.0.
>
>
> This is my java file:
> public class ExtBookMarkablePageLink<T> extends BookmarkablePageLink<T> {
>
> private final Component label;
>  public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
> pageClass) {
> this(id, pageClass, new PageParameters());
> }
>  public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
> pageClass, final PageParameters parameters) {
> super(id, pageClass, parameters);
> add(label = newLabel("label"));
> }
>     protected Component newLabel(final String markupId) {
>         return new Label(markupId, new
> Model<String>("")).setRenderBodyOnly(true);
>     }
>
> @Override
> protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
> return new PanelMarkupSourcingStrategy(true);
> }
>
>     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
>         this.label.setDefaultModel(label);
>         return this;
>     }
>
> }
>
> and this my html file:
> <!doctype html>
> <html xmlns:wicket="http://wicket.apache.org">
> <wicket:panel>
>   <span wicket:id="label"></span>
>   </wicket:panel>
> </html>
>



--
regards,

Vineet Semwal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

vineetsemwal
In reply to this post by Martin Grigorov-4
hi martin,
that static block need not be copied to make it work,since it's a static
block, it will get executed when the Panel class gets loaded,
the Panel class will get loaded by  PanelMarkupSourcingStrategy itself
since it's referring a constant of panel . yes but i agree not a very nice
code flow  so should be improved ,i always used to think they are doing
this in a very weird way :-)


On Tue, May 14, 2013 at 1:48 AM, Martin Grigorov <[hidden email]>wrote:

> Hi,
>
>
> On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]> wrote:
>
> > Get rid of your newMarkupSourcingStrategy() override and place the HTML
> > right next to the Java source code and you'll be fine.
> >
>
> This will not work because usually Link component has no its own markup
> file.
>
> See Panel.java. It has:
>
> static
> {
> // register "wicket:panel"
>  WicketTagIdentifier.registerWellKnownTagName(PANEL);
> }
>
> Just add this to your class and it should work.
>
> I think this is a bug in Wicket though - this piece of code should be
> executed by PanelMarkupSourcingStrategy, not by Panel itself.
>
> Feel free to file a bug report.
>
>
> >
> > If you do not like the default location of the HTML next to your Java
> > classes, then read Chapter 4 of the Wicket user guide you can get for
> free
> > from wicket's website at:
> > http://wicket.apache.org/learn/books/
> >
> > ~ Thank you,
> >   Paul Bors
> >
> > -----Original Message-----
> > From: Andy Van Den Heuvel [mailto:[hidden email]]
> > Sent: Monday, May 13, 2013 2:04 PM
> > To: [hidden email]
> > Subject: Unknown tag name with Wicket namespace: 'panel'
> >
> > I get an exception and it's not very clear to me what I'm doing wrong.
> >
> > This is the exception:
> > Last cause: Unknown tag name with Wicket namespace: 'panel'. Might be you
> > haven't installed the appropriate resolver? '<wicket:panel>' (line 3,
> > column
> > 2)
> >
> > I'm trying to override the markupSourcingStrategy because i want this
> class
> > to have it's own html file. Anybody an idea? I use wicket-core 6.7.0.
> >
> >
> > This is my java file:
> > public class ExtBookMarkablePageLink<T> extends BookmarkablePageLink<T> {
> >
> > private final Component label;
> >  public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
> > pageClass) {
> > this(id, pageClass, new PageParameters()); }  public <C extends Page>
> > ExtBookMarkablePageLink(String id, Class<C> pageClass, final
> PageParameters
> > parameters) { super(id, pageClass, parameters); add(label =
> > newLabel("label")); }
> >     protected Component newLabel(final String markupId) {
> >         return new Label(markupId, new
> > Model<String>("")).setRenderBodyOnly(true);
> >     }
> >
> > @Override
> > protected IMarkupSourcingStrategy newMarkupSourcingStrategy() { return
> new
> > PanelMarkupSourcingStrategy(true);
> > }
> >
> >     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
> >         this.label.setDefaultModel(label);
> >         return this;
> >     }
> >
> > }
> >
> > and this my html file:
> > <!doctype html>
> > <html xmlns:wicket="http://wicket.apache.org">
> > <wicket:panel>
> >   <span wicket:id="label"></span>
> >   </wicket:panel>
> > </html>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
> --
> Martin Grigorov
> Wicket Training & Consulting
> http://jWeekend.com <http://jweekend.com/>
>



--
regards,

Vineet Semwal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

Andy Van Den Heuvel
The html is right next to the javacode. I understand that Link does not
normally have a panel, but i want to have one.

This code is actually copied from wicket-bootstrap.
https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/button/BootstrapBookmarkablePageLink.java

And this works just fine on my pc :)


On Mon, May 13, 2013 at 11:09 PM, vineet semwal <[hidden email]>wrote:

> hi martin,
> that static block need not be copied to make it work,since it's a static
> block, it will get executed when the Panel class gets loaded,
> the Panel class will get loaded by  PanelMarkupSourcingStrategy itself
> since it's referring a constant of panel . yes but i agree not a very nice
> code flow  so should be improved ,i always used to think they are doing
> this in a very weird way :-)
>
>
> On Tue, May 14, 2013 at 1:48 AM, Martin Grigorov <[hidden email]
> >wrote:
>
> > Hi,
> >
> >
> > On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]> wrote:
> >
> > > Get rid of your newMarkupSourcingStrategy() override and place the HTML
> > > right next to the Java source code and you'll be fine.
> > >
> >
> > This will not work because usually Link component has no its own markup
> > file.
> >
> > See Panel.java. It has:
> >
> > static
> > {
> > // register "wicket:panel"
> >  WicketTagIdentifier.registerWellKnownTagName(PANEL);
> > }
> >
> > Just add this to your class and it should work.
> >
> > I think this is a bug in Wicket though - this piece of code should be
> > executed by PanelMarkupSourcingStrategy, not by Panel itself.
> >
> > Feel free to file a bug report.
> >
> >
> > >
> > > If you do not like the default location of the HTML next to your Java
> > > classes, then read Chapter 4 of the Wicket user guide you can get for
> > free
> > > from wicket's website at:
> > > http://wicket.apache.org/learn/books/
> > >
> > > ~ Thank you,
> > >   Paul Bors
> > >
> > > -----Original Message-----
> > > From: Andy Van Den Heuvel [mailto:[hidden email]]
> > > Sent: Monday, May 13, 2013 2:04 PM
> > > To: [hidden email]
> > > Subject: Unknown tag name with Wicket namespace: 'panel'
> > >
> > > I get an exception and it's not very clear to me what I'm doing wrong.
> > >
> > > This is the exception:
> > > Last cause: Unknown tag name with Wicket namespace: 'panel'. Might be
> you
> > > haven't installed the appropriate resolver? '<wicket:panel>' (line 3,
> > > column
> > > 2)
> > >
> > > I'm trying to override the markupSourcingStrategy because i want this
> > class
> > > to have it's own html file. Anybody an idea? I use wicket-core 6.7.0.
> > >
> > >
> > > This is my java file:
> > > public class ExtBookMarkablePageLink<T> extends
> BookmarkablePageLink<T> {
> > >
> > > private final Component label;
> > >  public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
> > > pageClass) {
> > > this(id, pageClass, new PageParameters()); }  public <C extends Page>
> > > ExtBookMarkablePageLink(String id, Class<C> pageClass, final
> > PageParameters
> > > parameters) { super(id, pageClass, parameters); add(label =
> > > newLabel("label")); }
> > >     protected Component newLabel(final String markupId) {
> > >         return new Label(markupId, new
> > > Model<String>("")).setRenderBodyOnly(true);
> > >     }
> > >
> > > @Override
> > > protected IMarkupSourcingStrategy newMarkupSourcingStrategy() { return
> > new
> > > PanelMarkupSourcingStrategy(true);
> > > }
> > >
> > >     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
> > >         this.label.setDefaultModel(label);
> > >         return this;
> > >     }
> > >
> > > }
> > >
> > > and this my html file:
> > > <!doctype html>
> > > <html xmlns:wicket="http://wicket.apache.org">
> > > <wicket:panel>
> > >   <span wicket:id="label"></span>
> > >   </wicket:panel>
> > > </html>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
> >
> > --
> > Martin Grigorov
> > Wicket Training & Consulting
> > http://jWeekend.com <http://jweekend.com/>
> >
>
>
>
> --
> regards,
>
> Vineet Semwal
>
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

Martin Grigorov-4
In reply to this post by vineetsemwal
Hi Vineet,


On Mon, May 13, 2013 at 11:09 PM, vineet semwal <[hidden email]>wrote:

> hi martin,
> that static block need not be copied to make it work,since it's a static
> block, it will get executed when the Panel class gets loaded,
> the Panel class will get loaded by  PanelMarkupSourcingStrategy itself
>

You are correct.
I have no idea why it failed for Andy the first time.


> since it's referring a constant of panel . yes but i agree not a very nice
> code flow  so should be improved ,i always used to think they are doing
> this in a very weird way :-)
>
>
> On Tue, May 14, 2013 at 1:48 AM, Martin Grigorov <[hidden email]
> >wrote:
>
> > Hi,
> >
> >
> > On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]> wrote:
> >
> > > Get rid of your newMarkupSourcingStrategy() override and place the HTML
> > > right next to the Java source code and you'll be fine.
> > >
> >
> > This will not work because usually Link component has no its own markup
> > file.
> >
> > See Panel.java. It has:
> >
> > static
> > {
> > // register "wicket:panel"
> >  WicketTagIdentifier.registerWellKnownTagName(PANEL);
> > }
> >
> > Just add this to your class and it should work.
> >
> > I think this is a bug in Wicket though - this piece of code should be
> > executed by PanelMarkupSourcingStrategy, not by Panel itself.
> >
> > Feel free to file a bug report.
> >
> >
> > >
> > > If you do not like the default location of the HTML next to your Java
> > > classes, then read Chapter 4 of the Wicket user guide you can get for
> > free
> > > from wicket's website at:
> > > http://wicket.apache.org/learn/books/
> > >
> > > ~ Thank you,
> > >   Paul Bors
> > >
> > > -----Original Message-----
> > > From: Andy Van Den Heuvel [mailto:[hidden email]]
> > > Sent: Monday, May 13, 2013 2:04 PM
> > > To: [hidden email]
> > > Subject: Unknown tag name with Wicket namespace: 'panel'
> > >
> > > I get an exception and it's not very clear to me what I'm doing wrong.
> > >
> > > This is the exception:
> > > Last cause: Unknown tag name with Wicket namespace: 'panel'. Might be
> you
> > > haven't installed the appropriate resolver? '<wicket:panel>' (line 3,
> > > column
> > > 2)
> > >
> > > I'm trying to override the markupSourcingStrategy because i want this
> > class
> > > to have it's own html file. Anybody an idea? I use wicket-core 6.7.0.
> > >
> > >
> > > This is my java file:
> > > public class ExtBookMarkablePageLink<T> extends
> BookmarkablePageLink<T> {
> > >
> > > private final Component label;
> > >  public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
> > > pageClass) {
> > > this(id, pageClass, new PageParameters()); }  public <C extends Page>
> > > ExtBookMarkablePageLink(String id, Class<C> pageClass, final
> > PageParameters
> > > parameters) { super(id, pageClass, parameters); add(label =
> > > newLabel("label")); }
> > >     protected Component newLabel(final String markupId) {
> > >         return new Label(markupId, new
> > > Model<String>("")).setRenderBodyOnly(true);
> > >     }
> > >
> > > @Override
> > > protected IMarkupSourcingStrategy newMarkupSourcingStrategy() { return
> > new
> > > PanelMarkupSourcingStrategy(true);
> > > }
> > >
> > >     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
> > >         this.label.setDefaultModel(label);
> > >         return this;
> > >     }
> > >
> > > }
> > >
> > > and this my html file:
> > > <!doctype html>
> > > <html xmlns:wicket="http://wicket.apache.org">
> > > <wicket:panel>
> > >   <span wicket:id="label"></span>
> > >   </wicket:panel>
> > > </html>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
> >
> > --
> > Martin Grigorov
> > Wicket Training & Consulting
> > http://jWeekend.com <http://jweekend.com/>
> >
>
>
>
> --
> regards,
>
> Vineet Semwal
>



--
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

Martin Grigorov-4
On Tue, May 14, 2013 at 9:51 AM, Martin Grigorov <[hidden email]>wrote:

> Hi Vineet,
>
>
> On Mon, May 13, 2013 at 11:09 PM, vineet semwal <[hidden email]>wrote:
>
>> hi martin,
>> that static block need not be copied to make it work,since it's a static
>> block, it will get executed when the Panel class gets loaded,
>> the Panel class will get loaded by  PanelMarkupSourcingStrategy itself
>>
>
> You are correct.
> I have no idea why it failed for Andy the first time.
>

Now I realize what happens.
The usage of Panel.PANEL is inlined in PanelMarkupSourcingStrategy at
compile time, i.e. its String value is put in the place of the constant.
That's why it doesn't trigger the static initializer.


>
>
>> since it's referring a constant of panel . yes but i agree not a very nice
>> code flow  so should be improved ,i always used to think they are doing
>> this in a very weird way :-)
>>
>>
>> On Tue, May 14, 2013 at 1:48 AM, Martin Grigorov <[hidden email]
>> >wrote:
>>
>> > Hi,
>> >
>> >
>> > On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]> wrote:
>> >
>> > > Get rid of your newMarkupSourcingStrategy() override and place the
>> HTML
>> > > right next to the Java source code and you'll be fine.
>> > >
>> >
>> > This will not work because usually Link component has no its own markup
>> > file.
>> >
>> > See Panel.java. It has:
>> >
>> > static
>> > {
>> > // register "wicket:panel"
>> >  WicketTagIdentifier.registerWellKnownTagName(PANEL);
>> > }
>> >
>> > Just add this to your class and it should work.
>> >
>> > I think this is a bug in Wicket though - this piece of code should be
>> > executed by PanelMarkupSourcingStrategy, not by Panel itself.
>> >
>> > Feel free to file a bug report.
>> >
>> >
>> > >
>> > > If you do not like the default location of the HTML next to your Java
>> > > classes, then read Chapter 4 of the Wicket user guide you can get for
>> > free
>> > > from wicket's website at:
>> > > http://wicket.apache.org/learn/books/
>> > >
>> > > ~ Thank you,
>> > >   Paul Bors
>> > >
>> > > -----Original Message-----
>> > > From: Andy Van Den Heuvel [mailto:[hidden email]]
>> > > Sent: Monday, May 13, 2013 2:04 PM
>> > > To: [hidden email]
>> > > Subject: Unknown tag name with Wicket namespace: 'panel'
>> > >
>> > > I get an exception and it's not very clear to me what I'm doing wrong.
>> > >
>> > > This is the exception:
>> > > Last cause: Unknown tag name with Wicket namespace: 'panel'. Might be
>> you
>> > > haven't installed the appropriate resolver? '<wicket:panel>' (line 3,
>> > > column
>> > > 2)
>> > >
>> > > I'm trying to override the markupSourcingStrategy because i want this
>> > class
>> > > to have it's own html file. Anybody an idea? I use wicket-core 6.7.0.
>> > >
>> > >
>> > > This is my java file:
>> > > public class ExtBookMarkablePageLink<T> extends
>> BookmarkablePageLink<T> {
>> > >
>> > > private final Component label;
>> > >  public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
>> > > pageClass) {
>> > > this(id, pageClass, new PageParameters()); }  public <C extends Page>
>> > > ExtBookMarkablePageLink(String id, Class<C> pageClass, final
>> > PageParameters
>> > > parameters) { super(id, pageClass, parameters); add(label =
>> > > newLabel("label")); }
>> > >     protected Component newLabel(final String markupId) {
>> > >         return new Label(markupId, new
>> > > Model<String>("")).setRenderBodyOnly(true);
>> > >     }
>> > >
>> > > @Override
>> > > protected IMarkupSourcingStrategy newMarkupSourcingStrategy() { return
>> > new
>> > > PanelMarkupSourcingStrategy(true);
>> > > }
>> > >
>> > >     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
>> > >         this.label.setDefaultModel(label);
>> > >         return this;
>> > >     }
>> > >
>> > > }
>> > >
>> > > and this my html file:
>> > > <!doctype html>
>> > > <html xmlns:wicket="http://wicket.apache.org">
>> > > <wicket:panel>
>> > >   <span wicket:id="label"></span>
>> > >   </wicket:panel>
>> > > </html>
>> > >
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: [hidden email]
>> > > For additional commands, e-mail: [hidden email]
>> > >
>> > >
>> >
>> >
>> > --
>> > Martin Grigorov
>> > Wicket Training & Consulting
>> > http://jWeekend.com <http://jweekend.com/>
>> >
>>
>>
>>
>> --
>> regards,
>>
>> Vineet Semwal
>>
>
>
>
> --
> Martin Grigorov
> Wicket Training & Consulting
> http://jWeekend.com <http://jweekend.com/>
>



--
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

vineetsemwal
Martin,
thanks for the explanation,you are right ! ,i just tested that static block
doesn't get executed .. but i could never reproduce  Andy's problem ..,
i also checked and noticed that WicketTagIdentifier is registering the
"panel" tagname  so i don't know what is registering it but it's getting
registered ,i tried looking a bit at code but could not find it ..


On Tue, May 14, 2013 at 5:18 PM, Martin Grigorov <[hidden email]>wrote:

> On Tue, May 14, 2013 at 9:51 AM, Martin Grigorov <[hidden email]
> >wrote:
>
> > Hi Vineet,
> >
> >
> > On Mon, May 13, 2013 at 11:09 PM, vineet semwal <
> [hidden email]>wrote:
> >
> >> hi martin,
> >> that static block need not be copied to make it work,since it's a static
> >> block, it will get executed when the Panel class gets loaded,
> >> the Panel class will get loaded by  PanelMarkupSourcingStrategy itself
> >>
> >
> > You are correct.
> > I have no idea why it failed for Andy the first time.
> >
>
> Now I realize what happens.
> The usage of Panel.PANEL is inlined in PanelMarkupSourcingStrategy at
> compile time, i.e. its String value is put in the place of the constant.
> That's why it doesn't trigger the static initializer.
>
>
> >
> >
> >> since it's referring a constant of panel . yes but i agree not a very
> nice
> >> code flow  so should be improved ,i always used to think they are doing
> >> this in a very weird way :-)
> >>
> >>
> >> On Tue, May 14, 2013 at 1:48 AM, Martin Grigorov <[hidden email]
> >> >wrote:
> >>
> >> > Hi,
> >> >
> >> >
> >> > On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]> wrote:
> >> >
> >> > > Get rid of your newMarkupSourcingStrategy() override and place the
> >> HTML
> >> > > right next to the Java source code and you'll be fine.
> >> > >
> >> >
> >> > This will not work because usually Link component has no its own
> markup
> >> > file.
> >> >
> >> > See Panel.java. It has:
> >> >
> >> > static
> >> > {
> >> > // register "wicket:panel"
> >> >  WicketTagIdentifier.registerWellKnownTagName(PANEL);
> >> > }
> >> >
> >> > Just add this to your class and it should work.
> >> >
> >> > I think this is a bug in Wicket though - this piece of code should be
> >> > executed by PanelMarkupSourcingStrategy, not by Panel itself.
> >> >
> >> > Feel free to file a bug report.
> >> >
> >> >
> >> > >
> >> > > If you do not like the default location of the HTML next to your
> Java
> >> > > classes, then read Chapter 4 of the Wicket user guide you can get
> for
> >> > free
> >> > > from wicket's website at:
> >> > > http://wicket.apache.org/learn/books/
> >> > >
> >> > > ~ Thank you,
> >> > >   Paul Bors
> >> > >
> >> > > -----Original Message-----
> >> > > From: Andy Van Den Heuvel [mailto:[hidden email]]
> >> > > Sent: Monday, May 13, 2013 2:04 PM
> >> > > To: [hidden email]
> >> > > Subject: Unknown tag name with Wicket namespace: 'panel'
> >> > >
> >> > > I get an exception and it's not very clear to me what I'm doing
> wrong.
> >> > >
> >> > > This is the exception:
> >> > > Last cause: Unknown tag name with Wicket namespace: 'panel'. Might
> be
> >> you
> >> > > haven't installed the appropriate resolver? '<wicket:panel>' (line
> 3,
> >> > > column
> >> > > 2)
> >> > >
> >> > > I'm trying to override the markupSourcingStrategy because i want
> this
> >> > class
> >> > > to have it's own html file. Anybody an idea? I use wicket-core
> 6.7.0.
> >> > >
> >> > >
> >> > > This is my java file:
> >> > > public class ExtBookMarkablePageLink<T> extends
> >> BookmarkablePageLink<T> {
> >> > >
> >> > > private final Component label;
> >> > >  public <C extends Page> ExtBookMarkablePageLink(String id, Class<C>
> >> > > pageClass) {
> >> > > this(id, pageClass, new PageParameters()); }  public <C extends
> Page>
> >> > > ExtBookMarkablePageLink(String id, Class<C> pageClass, final
> >> > PageParameters
> >> > > parameters) { super(id, pageClass, parameters); add(label =
> >> > > newLabel("label")); }
> >> > >     protected Component newLabel(final String markupId) {
> >> > >         return new Label(markupId, new
> >> > > Model<String>("")).setRenderBodyOnly(true);
> >> > >     }
> >> > >
> >> > > @Override
> >> > > protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
> return
> >> > new
> >> > > PanelMarkupSourcingStrategy(true);
> >> > > }
> >> > >
> >> > >     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
> >> > >         this.label.setDefaultModel(label);
> >> > >         return this;
> >> > >     }
> >> > >
> >> > > }
> >> > >
> >> > > and this my html file:
> >> > > <!doctype html>
> >> > > <html xmlns:wicket="http://wicket.apache.org">
> >> > > <wicket:panel>
> >> > >   <span wicket:id="label"></span>
> >> > >   </wicket:panel>
> >> > > </html>
> >> > >
> >> > >
> >> > >
> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: [hidden email]
> >> > > For additional commands, e-mail: [hidden email]
> >> > >
> >> > >
> >> >
> >> >
> >> > --
> >> > Martin Grigorov
> >> > Wicket Training & Consulting
> >> > http://jWeekend.com <http://jweekend.com/>
> >> >
> >>
> >>
> >>
> >> --
> >> regards,
> >>
> >> Vineet Semwal
> >>
> >
> >
> >
> > --
> > Martin Grigorov
> > Wicket Training & Consulting
> > http://jWeekend.com <http://jweekend.com/>
> >
>
>
>
> --
> Martin Grigorov
> Wicket Training & Consulting
> http://jWeekend.com <http://jweekend.com/>
>



--
regards,

Vineet Semwal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

vineetsemwal
also why is well known tagnames getting registered and why are not they
just kept at start itself,they are just strings ,registering only makes
sense for the new tags in my opinion..


On Tue, May 14, 2013 at 6:45 PM, vineet semwal <[hidden email]>wrote:

> Martin,
> thanks for the explanation,you are right ! ,i just tested that static
> block doesn't get executed .. but i could never reproduce  Andy's problem
> ..,
> i also checked and noticed that WicketTagIdentifier is registering the
> "panel" tagname  so i don't know what is registering it but it's getting
> registered ,i tried looking a bit at code but could not find it ..
>
>
> On Tue, May 14, 2013 at 5:18 PM, Martin Grigorov <[hidden email]>wrote:
>
>> On Tue, May 14, 2013 at 9:51 AM, Martin Grigorov <[hidden email]
>> >wrote:
>>
>> > Hi Vineet,
>> >
>> >
>> > On Mon, May 13, 2013 at 11:09 PM, vineet semwal <
>> [hidden email]>wrote:
>> >
>> >> hi martin,
>> >> that static block need not be copied to make it work,since it's a
>> static
>> >> block, it will get executed when the Panel class gets loaded,
>> >> the Panel class will get loaded by  PanelMarkupSourcingStrategy itself
>> >>
>> >
>> > You are correct.
>> > I have no idea why it failed for Andy the first time.
>> >
>>
>> Now I realize what happens.
>> The usage of Panel.PANEL is inlined in PanelMarkupSourcingStrategy at
>> compile time, i.e. its String value is put in the place of the constant.
>> That's why it doesn't trigger the static initializer.
>>
>>
>> >
>> >
>> >> since it's referring a constant of panel . yes but i agree not a very
>> nice
>> >> code flow  so should be improved ,i always used to think they are doing
>> >> this in a very weird way :-)
>> >>
>> >>
>> >> On Tue, May 14, 2013 at 1:48 AM, Martin Grigorov <[hidden email]
>> >> >wrote:
>> >>
>> >> > Hi,
>> >> >
>> >> >
>> >> > On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]> wrote:
>> >> >
>> >> > > Get rid of your newMarkupSourcingStrategy() override and place the
>> >> HTML
>> >> > > right next to the Java source code and you'll be fine.
>> >> > >
>> >> >
>> >> > This will not work because usually Link component has no its own
>> markup
>> >> > file.
>> >> >
>> >> > See Panel.java. It has:
>> >> >
>> >> > static
>> >> > {
>> >> > // register "wicket:panel"
>> >> >  WicketTagIdentifier.registerWellKnownTagName(PANEL);
>> >> > }
>> >> >
>> >> > Just add this to your class and it should work.
>> >> >
>> >> > I think this is a bug in Wicket though - this piece of code should be
>> >> > executed by PanelMarkupSourcingStrategy, not by Panel itself.
>> >> >
>> >> > Feel free to file a bug report.
>> >> >
>> >> >
>> >> > >
>> >> > > If you do not like the default location of the HTML next to your
>> Java
>> >> > > classes, then read Chapter 4 of the Wicket user guide you can get
>> for
>> >> > free
>> >> > > from wicket's website at:
>> >> > > http://wicket.apache.org/learn/books/
>> >> > >
>> >> > > ~ Thank you,
>> >> > >   Paul Bors
>> >> > >
>> >> > > -----Original Message-----
>> >> > > From: Andy Van Den Heuvel [mailto:[hidden email]]
>> >> > > Sent: Monday, May 13, 2013 2:04 PM
>> >> > > To: [hidden email]
>> >> > > Subject: Unknown tag name with Wicket namespace: 'panel'
>> >> > >
>> >> > > I get an exception and it's not very clear to me what I'm doing
>> wrong.
>> >> > >
>> >> > > This is the exception:
>> >> > > Last cause: Unknown tag name with Wicket namespace: 'panel'. Might
>> be
>> >> you
>> >> > > haven't installed the appropriate resolver? '<wicket:panel>' (line
>> 3,
>> >> > > column
>> >> > > 2)
>> >> > >
>> >> > > I'm trying to override the markupSourcingStrategy because i want
>> this
>> >> > class
>> >> > > to have it's own html file. Anybody an idea? I use wicket-core
>> 6.7.0.
>> >> > >
>> >> > >
>> >> > > This is my java file:
>> >> > > public class ExtBookMarkablePageLink<T> extends
>> >> BookmarkablePageLink<T> {
>> >> > >
>> >> > > private final Component label;
>> >> > >  public <C extends Page> ExtBookMarkablePageLink(String id,
>> Class<C>
>> >> > > pageClass) {
>> >> > > this(id, pageClass, new PageParameters()); }  public <C extends
>> Page>
>> >> > > ExtBookMarkablePageLink(String id, Class<C> pageClass, final
>> >> > PageParameters
>> >> > > parameters) { super(id, pageClass, parameters); add(label =
>> >> > > newLabel("label")); }
>> >> > >     protected Component newLabel(final String markupId) {
>> >> > >         return new Label(markupId, new
>> >> > > Model<String>("")).setRenderBodyOnly(true);
>> >> > >     }
>> >> > >
>> >> > > @Override
>> >> > > protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
>> return
>> >> > new
>> >> > > PanelMarkupSourcingStrategy(true);
>> >> > > }
>> >> > >
>> >> > >     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
>> >> > >         this.label.setDefaultModel(label);
>> >> > >         return this;
>> >> > >     }
>> >> > >
>> >> > > }
>> >> > >
>> >> > > and this my html file:
>> >> > > <!doctype html>
>> >> > > <html xmlns:wicket="http://wicket.apache.org">
>> >> > > <wicket:panel>
>> >> > >   <span wicket:id="label"></span>
>> >> > >   </wicket:panel>
>> >> > > </html>
>> >> > >
>> >> > >
>> >> > >
>> ---------------------------------------------------------------------
>> >> > > To unsubscribe, e-mail: [hidden email]
>> >> > > For additional commands, e-mail: [hidden email]
>> >> > >
>> >> > >
>> >> >
>> >> >
>> >> > --
>> >> > Martin Grigorov
>> >> > Wicket Training & Consulting
>> >> > http://jWeekend.com <http://jweekend.com/>
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> regards,
>> >>
>> >> Vineet Semwal
>> >>
>> >
>> >
>> >
>> > --
>> > Martin Grigorov
>> > Wicket Training & Consulting
>> > http://jWeekend.com <http://jweekend.com/>
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> Wicket Training & Consulting
>> http://jWeekend.com <http://jweekend.com/>
>>
>
>
>
> --
> regards,
>
> Vineet Semwal
>



--
regards,

Vineet Semwal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

Martin Grigorov-4
On Tue, May 14, 2013 at 3:28 PM, vineet semwal <[hidden email]>wrote:

> also why is well known tagnames getting registered and why are not they
> just kept at start itself,they are just strings ,registering only makes
> sense for the new tags in my opinion..
>
>
Agreed.
We can pre-register all known tags like: panel, border, head, container,
etc.
No need to do this lazily.
org.apache.wicket.markup.parser.filter.WicketTagIdentifier#wellKnownTagNames
is a static HashSet<String>. It won't be too much memory consumption.

Please file a ticket.


>
> On Tue, May 14, 2013 at 6:45 PM, vineet semwal <[hidden email]
> >wrote:
>
> > Martin,
> > thanks for the explanation,you are right ! ,i just tested that static
> > block doesn't get executed .. but i could never reproduce  Andy's problem
> > ..,
> > i also checked and noticed that WicketTagIdentifier is registering the
> > "panel" tagname  so i don't know what is registering it but it's getting
> > registered ,i tried looking a bit at code but could not find it ..
> >
> >
> > On Tue, May 14, 2013 at 5:18 PM, Martin Grigorov <[hidden email]
> >wrote:
> >
> >> On Tue, May 14, 2013 at 9:51 AM, Martin Grigorov <[hidden email]
> >> >wrote:
> >>
> >> > Hi Vineet,
> >> >
> >> >
> >> > On Mon, May 13, 2013 at 11:09 PM, vineet semwal <
> >> [hidden email]>wrote:
> >> >
> >> >> hi martin,
> >> >> that static block need not be copied to make it work,since it's a
> >> static
> >> >> block, it will get executed when the Panel class gets loaded,
> >> >> the Panel class will get loaded by  PanelMarkupSourcingStrategy
> itself
> >> >>
> >> >
> >> > You are correct.
> >> > I have no idea why it failed for Andy the first time.
> >> >
> >>
> >> Now I realize what happens.
> >> The usage of Panel.PANEL is inlined in PanelMarkupSourcingStrategy at
> >> compile time, i.e. its String value is put in the place of the constant.
> >> That's why it doesn't trigger the static initializer.
> >>
> >>
> >> >
> >> >
> >> >> since it's referring a constant of panel . yes but i agree not a very
> >> nice
> >> >> code flow  so should be improved ,i always used to think they are
> doing
> >> >> this in a very weird way :-)
> >> >>
> >> >>
> >> >> On Tue, May 14, 2013 at 1:48 AM, Martin Grigorov <
> [hidden email]
> >> >> >wrote:
> >> >>
> >> >> > Hi,
> >> >> >
> >> >> >
> >> >> > On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]> wrote:
> >> >> >
> >> >> > > Get rid of your newMarkupSourcingStrategy() override and place
> the
> >> >> HTML
> >> >> > > right next to the Java source code and you'll be fine.
> >> >> > >
> >> >> >
> >> >> > This will not work because usually Link component has no its own
> >> markup
> >> >> > file.
> >> >> >
> >> >> > See Panel.java. It has:
> >> >> >
> >> >> > static
> >> >> > {
> >> >> > // register "wicket:panel"
> >> >> >  WicketTagIdentifier.registerWellKnownTagName(PANEL);
> >> >> > }
> >> >> >
> >> >> > Just add this to your class and it should work.
> >> >> >
> >> >> > I think this is a bug in Wicket though - this piece of code should
> be
> >> >> > executed by PanelMarkupSourcingStrategy, not by Panel itself.
> >> >> >
> >> >> > Feel free to file a bug report.
> >> >> >
> >> >> >
> >> >> > >
> >> >> > > If you do not like the default location of the HTML next to your
> >> Java
> >> >> > > classes, then read Chapter 4 of the Wicket user guide you can get
> >> for
> >> >> > free
> >> >> > > from wicket's website at:
> >> >> > > http://wicket.apache.org/learn/books/
> >> >> > >
> >> >> > > ~ Thank you,
> >> >> > >   Paul Bors
> >> >> > >
> >> >> > > -----Original Message-----
> >> >> > > From: Andy Van Den Heuvel [mailto:[hidden email]]
> >> >> > > Sent: Monday, May 13, 2013 2:04 PM
> >> >> > > To: [hidden email]
> >> >> > > Subject: Unknown tag name with Wicket namespace: 'panel'
> >> >> > >
> >> >> > > I get an exception and it's not very clear to me what I'm doing
> >> wrong.
> >> >> > >
> >> >> > > This is the exception:
> >> >> > > Last cause: Unknown tag name with Wicket namespace: 'panel'.
> Might
> >> be
> >> >> you
> >> >> > > haven't installed the appropriate resolver? '<wicket:panel>'
> (line
> >> 3,
> >> >> > > column
> >> >> > > 2)
> >> >> > >
> >> >> > > I'm trying to override the markupSourcingStrategy because i want
> >> this
> >> >> > class
> >> >> > > to have it's own html file. Anybody an idea? I use wicket-core
> >> 6.7.0.
> >> >> > >
> >> >> > >
> >> >> > > This is my java file:
> >> >> > > public class ExtBookMarkablePageLink<T> extends
> >> >> BookmarkablePageLink<T> {
> >> >> > >
> >> >> > > private final Component label;
> >> >> > >  public <C extends Page> ExtBookMarkablePageLink(String id,
> >> Class<C>
> >> >> > > pageClass) {
> >> >> > > this(id, pageClass, new PageParameters()); }  public <C extends
> >> Page>
> >> >> > > ExtBookMarkablePageLink(String id, Class<C> pageClass, final
> >> >> > PageParameters
> >> >> > > parameters) { super(id, pageClass, parameters); add(label =
> >> >> > > newLabel("label")); }
> >> >> > >     protected Component newLabel(final String markupId) {
> >> >> > >         return new Label(markupId, new
> >> >> > > Model<String>("")).setRenderBodyOnly(true);
> >> >> > >     }
> >> >> > >
> >> >> > > @Override
> >> >> > > protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
> >> return
> >> >> > new
> >> >> > > PanelMarkupSourcingStrategy(true);
> >> >> > > }
> >> >> > >
> >> >> > >     public ExtBookMarkablePageLink<T> setLabel(IModel<?> label) {
> >> >> > >         this.label.setDefaultModel(label);
> >> >> > >         return this;
> >> >> > >     }
> >> >> > >
> >> >> > > }
> >> >> > >
> >> >> > > and this my html file:
> >> >> > > <!doctype html>
> >> >> > > <html xmlns:wicket="http://wicket.apache.org">
> >> >> > > <wicket:panel>
> >> >> > >   <span wicket:id="label"></span>
> >> >> > >   </wicket:panel>
> >> >> > > </html>
> >> >> > >
> >> >> > >
> >> >> > >
> >> ---------------------------------------------------------------------
> >> >> > > To unsubscribe, e-mail: [hidden email]
> >> >> > > For additional commands, e-mail: [hidden email]
> >> >> > >
> >> >> > >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Martin Grigorov
> >> >> > Wicket Training & Consulting
> >> >> > http://jWeekend.com <http://jweekend.com/>
> >> >> >
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> regards,
> >> >>
> >> >> Vineet Semwal
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Martin Grigorov
> >> > Wicket Training & Consulting
> >> > http://jWeekend.com <http://jweekend.com/>
> >> >
> >>
> >>
> >>
> >> --
> >> Martin Grigorov
> >> Wicket Training & Consulting
> >> http://jWeekend.com <http://jweekend.com/>
> >>
> >
> >
> >
> > --
> > regards,
> >
> > Vineet Semwal
> >
>
>
>
> --
> regards,
>
> Vineet Semwal
>



--
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

vineetsemwal
i have just created issue https://issues.apache.org/jira/browse/WICKET-5189
thank you !



On Tue, May 14, 2013 at 7:15 PM, Martin Grigorov <[hidden email]>wrote:

> On Tue, May 14, 2013 at 3:28 PM, vineet semwal <[hidden email]
> >wrote:
>
> > also why is well known tagnames getting registered and why are not they
> > just kept at start itself,they are just strings ,registering only makes
> > sense for the new tags in my opinion..
> >
> >
> Agreed.
> We can pre-register all known tags like: panel, border, head, container,
> etc.
> No need to do this lazily.
>
> org.apache.wicket.markup.parser.filter.WicketTagIdentifier#wellKnownTagNames
> is a static HashSet<String>. It won't be too much memory consumption.
>
> Please file a ticket.
>
>
> >
> > On Tue, May 14, 2013 at 6:45 PM, vineet semwal <[hidden email]
> > >wrote:
> >
> > > Martin,
> > > thanks for the explanation,you are right ! ,i just tested that static
> > > block doesn't get executed .. but i could never reproduce  Andy's
> problem
> > > ..,
> > > i also checked and noticed that WicketTagIdentifier is registering the
> > > "panel" tagname  so i don't know what is registering it but it's
> getting
> > > registered ,i tried looking a bit at code but could not find it ..
> > >
> > >
> > > On Tue, May 14, 2013 at 5:18 PM, Martin Grigorov <[hidden email]
> > >wrote:
> > >
> > >> On Tue, May 14, 2013 at 9:51 AM, Martin Grigorov <
> [hidden email]
> > >> >wrote:
> > >>
> > >> > Hi Vineet,
> > >> >
> > >> >
> > >> > On Mon, May 13, 2013 at 11:09 PM, vineet semwal <
> > >> [hidden email]>wrote:
> > >> >
> > >> >> hi martin,
> > >> >> that static block need not be copied to make it work,since it's a
> > >> static
> > >> >> block, it will get executed when the Panel class gets loaded,
> > >> >> the Panel class will get loaded by  PanelMarkupSourcingStrategy
> > itself
> > >> >>
> > >> >
> > >> > You are correct.
> > >> > I have no idea why it failed for Andy the first time.
> > >> >
> > >>
> > >> Now I realize what happens.
> > >> The usage of Panel.PANEL is inlined in PanelMarkupSourcingStrategy at
> > >> compile time, i.e. its String value is put in the place of the
> constant.
> > >> That's why it doesn't trigger the static initializer.
> > >>
> > >>
> > >> >
> > >> >
> > >> >> since it's referring a constant of panel . yes but i agree not a
> very
> > >> nice
> > >> >> code flow  so should be improved ,i always used to think they are
> > doing
> > >> >> this in a very weird way :-)
> > >> >>
> > >> >>
> > >> >> On Tue, May 14, 2013 at 1:48 AM, Martin Grigorov <
> > [hidden email]
> > >> >> >wrote:
> > >> >>
> > >> >> > Hi,
> > >> >> >
> > >> >> >
> > >> >> > On Mon, May 13, 2013 at 10:02 PM, Paul Bors <[hidden email]>
> wrote:
> > >> >> >
> > >> >> > > Get rid of your newMarkupSourcingStrategy() override and place
> > the
> > >> >> HTML
> > >> >> > > right next to the Java source code and you'll be fine.
> > >> >> > >
> > >> >> >
> > >> >> > This will not work because usually Link component has no its own
> > >> markup
> > >> >> > file.
> > >> >> >
> > >> >> > See Panel.java. It has:
> > >> >> >
> > >> >> > static
> > >> >> > {
> > >> >> > // register "wicket:panel"
> > >> >> >  WicketTagIdentifier.registerWellKnownTagName(PANEL);
> > >> >> > }
> > >> >> >
> > >> >> > Just add this to your class and it should work.
> > >> >> >
> > >> >> > I think this is a bug in Wicket though - this piece of code
> should
> > be
> > >> >> > executed by PanelMarkupSourcingStrategy, not by Panel itself.
> > >> >> >
> > >> >> > Feel free to file a bug report.
> > >> >> >
> > >> >> >
> > >> >> > >
> > >> >> > > If you do not like the default location of the HTML next to
> your
> > >> Java
> > >> >> > > classes, then read Chapter 4 of the Wicket user guide you can
> get
> > >> for
> > >> >> > free
> > >> >> > > from wicket's website at:
> > >> >> > > http://wicket.apache.org/learn/books/
> > >> >> > >
> > >> >> > > ~ Thank you,
> > >> >> > >   Paul Bors
> > >> >> > >
> > >> >> > > -----Original Message-----
> > >> >> > > From: Andy Van Den Heuvel [mailto:[hidden email]]
> > >> >> > > Sent: Monday, May 13, 2013 2:04 PM
> > >> >> > > To: [hidden email]
> > >> >> > > Subject: Unknown tag name with Wicket namespace: 'panel'
> > >> >> > >
> > >> >> > > I get an exception and it's not very clear to me what I'm doing
> > >> wrong.
> > >> >> > >
> > >> >> > > This is the exception:
> > >> >> > > Last cause: Unknown tag name with Wicket namespace: 'panel'.
> > Might
> > >> be
> > >> >> you
> > >> >> > > haven't installed the appropriate resolver? '<wicket:panel>'
> > (line
> > >> 3,
> > >> >> > > column
> > >> >> > > 2)
> > >> >> > >
> > >> >> > > I'm trying to override the markupSourcingStrategy because i
> want
> > >> this
> > >> >> > class
> > >> >> > > to have it's own html file. Anybody an idea? I use wicket-core
> > >> 6.7.0.
> > >> >> > >
> > >> >> > >
> > >> >> > > This is my java file:
> > >> >> > > public class ExtBookMarkablePageLink<T> extends
> > >> >> BookmarkablePageLink<T> {
> > >> >> > >
> > >> >> > > private final Component label;
> > >> >> > >  public <C extends Page> ExtBookMarkablePageLink(String id,
> > >> Class<C>
> > >> >> > > pageClass) {
> > >> >> > > this(id, pageClass, new PageParameters()); }  public <C extends
> > >> Page>
> > >> >> > > ExtBookMarkablePageLink(String id, Class<C> pageClass, final
> > >> >> > PageParameters
> > >> >> > > parameters) { super(id, pageClass, parameters); add(label =
> > >> >> > > newLabel("label")); }
> > >> >> > >     protected Component newLabel(final String markupId) {
> > >> >> > >         return new Label(markupId, new
> > >> >> > > Model<String>("")).setRenderBodyOnly(true);
> > >> >> > >     }
> > >> >> > >
> > >> >> > > @Override
> > >> >> > > protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
> > >> return
> > >> >> > new
> > >> >> > > PanelMarkupSourcingStrategy(true);
> > >> >> > > }
> > >> >> > >
> > >> >> > >     public ExtBookMarkablePageLink<T> setLabel(IModel<?>
> label) {
> > >> >> > >         this.label.setDefaultModel(label);
> > >> >> > >         return this;
> > >> >> > >     }
> > >> >> > >
> > >> >> > > }
> > >> >> > >
> > >> >> > > and this my html file:
> > >> >> > > <!doctype html>
> > >> >> > > <html xmlns:wicket="http://wicket.apache.org">
> > >> >> > > <wicket:panel>
> > >> >> > >   <span wicket:id="label"></span>
> > >> >> > >   </wicket:panel>
> > >> >> > > </html>
> > >> >> > >
> > >> >> > >
> > >> >> > >
> > >> ---------------------------------------------------------------------
> > >> >> > > To unsubscribe, e-mail: [hidden email]
> > >> >> > > For additional commands, e-mail: [hidden email]
> > >> >> > >
> > >> >> > >
> > >> >> >
> > >> >> >
> > >> >> > --
> > >> >> > Martin Grigorov
> > >> >> > Wicket Training & Consulting
> > >> >> > http://jWeekend.com <http://jweekend.com/>
> > >> >> >
> > >> >>
> > >> >>
> > >> >>
> > >> >> --
> > >> >> regards,
> > >> >>
> > >> >> Vineet Semwal
> > >> >>
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > Martin Grigorov
> > >> > Wicket Training & Consulting
> > >> > http://jWeekend.com <http://jweekend.com/>
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Martin Grigorov
> > >> Wicket Training & Consulting
> > >> http://jWeekend.com <http://jweekend.com/>
> > >>
> > >
> > >
> > >
> > > --
> > > regards,
> > >
> > > Vineet Semwal
> > >
> >
> >
> >
> > --
> > regards,
> >
> > Vineet Semwal
> >
>
>
>
> --
> Martin Grigorov
> Wicket Training & Consulting
> http://jWeekend.com <http://jweekend.com/>
>



--
regards,

Vineet Semwal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown tag name with Wicket namespace: 'panel'

vineetsemwal
In reply to this post by vineetsemwal
On Tue, May 14, 2013 at 6:45 PM, vineet semwal <[hidden email]>wrote:

> Martin,
> thanks for the explanation,you are right ! ,i just tested that static
> block doesn't get executed .. but i could never reproduce  Andy's problem
> ..,
> i also checked and noticed that WicketTagIdentifier is registering the
> "panel" tagname  so i don't know what is registering it but it's getting
> registered ,i tried looking a bit at code but could not find it ..
>
> actually later yesterday i was able to reproduce the problem in a pure
quickstart ,earlier i was testing on some test project where i
test/experiment odd things,something there was registering the panel
tagname ,i also realized
that corresponding issue was created and fixed so all is well :-)