Interesting. I thought I had a testcase with exactly that DOCTYPE. In
any case it returns the DOCTYPE of the page only, irrespective of
Panel or Border etc.
getMarkup() returning null means no markup found which would explain
the NPE as well. You are sure about your source code and markup?

Juergen


On Wed, Dec 8, 2010 at 5:27 PM, Martin Grigorov
<[email protected]> wrote:
> Hi Juergen,
>
> I just tried to use MarkupUtil.isMarkupHtml5Compliant() for the new HTML5
> input types and it failed with:
>
> Caused by: java.lang.NullPointerException
> at org.apache.wicket.markup.html.MarkupUtil$1.component(MarkupUtil.java:56)
> at org.apache.wicket.markup.html.MarkupUtil$1.component(MarkupUtil.java:1)
> at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:142)
> at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:118)
> at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:919)
> at
> org.apache.wicket.markup.html.MarkupUtil.isMarkupHtml5Compliant(MarkupUtil.java:52)
> at
> org.wicketstuff.html5.markup.html.form.NumberField.onInitialize(NumberField.java:38)
> at org.apache.wicket.Component.fireInitialize(Component.java:989)
> at org.apache.wicket.MarkupContainer.initialize(MarkupContainer.java:992)
> at
> org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:972)
> at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:162)
> at
> org.wicketstuff.html5.markup.html.form.NumberFieldDemo.<init>(NumberFieldDemo.java:19)
>
>
> So I changed MarkupUtil line 56:
> MarkupResourceStream rs =
> comp.getAssociatedMarkup().getMarkupResourceStream();
> with
> MarkupResourceStream rs = comp.getMarkup().getMarkupResourceStream();
>
> and now there is no NPE but it returns "null" for doctype.
>
> The page HTML looks like:
>
> http://pastie.org/1359239
>
> The code is at
> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/jdk-1.6-parent/wicket-html5-parent
> see NumberFieldDemo in examples and NumberField in impl project.
>
> martin-g
>

Reply via email to