Re: Wicket page has a redirect loop

2012-06-05 Thread paulstar
You are right.  I found out the 'markupProvider' is null by debugging, thanks
to Tom to "fores" me to do it.

In Wicket 1.3 & 1.4, I overrided 'getAssociatedMarkupStream(boolean
throwException)' so that the class extends from Fragment doesn't have to
provide 'markupProvider'.  After upgraded to Wicket 1.5, I simply set the
'markupProvider' to null so that it compiled, but ran into NPE.

So I changed my code from:
public static class FormField extends Fragment {
public FormField(String markupId, Component c, IModel label, 
IModel m) {
super("fragmentId", markupId, null, m);
this.labelModel = label;
this.c = c;
}
..
}

to:
public static class FormField extends Fragment {
public FormField(String markupId, Component c, IModel label, 
IModel m,
MarkupContainer markupProvider) {
super("fragmentId", markupId, markupProvider, m);
this.labelModel = label;
this.c = c;
}
..
}

The problem is there are many 'new FormField()' codes, a big changes.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-page-has-a-redirect-loop-tp4649664p4649746.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket page has a redirect loop

2012-06-02 Thread Martin Grigorov
Hi,

I guess 'markupProvider' is null.
This is improved in 1.5.7 to not fail with NPE.
But even in 1.5.7 your app will fail with :
throw new MarkupNotFoundException("No Markup found for Fragment " + markupId +
" in providing markup container " + 
getMarkupProvider(container));

For some reason the Fragment's markup cannot be found. Most probably
you have usage of IComponentResolver near by this Fragment...

On Fri, Jun 1, 2012 at 9:02 PM, Thomas Götz  wrote:
> Hm, put a breakpoint in FragmentMarkupSourcingStrategy.java:143 and see what 
> causes the NullPointerException.
>
>   -Tom
>
>
> On 01.06.2012 at 19:08 paulstar wrote:
>
>> Caused by: java.lang.NullPointerException
>>        at
>> org.apache.wicket.markup.html.panel.FragmentMarkupSourcingStrategy.getMarkup(FragmentMarkupSourcingStrategy.java:143)
>>        at
>> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:448)
>>        at org.apache.wicket.Component.getMarkup(Component.java:737)
>>        at
>> org.apache.wicket.markup.html.list.ListView.getMarkup(ListView.java:662)
>>        at org.apache.wicket.Component.getMarkup(Component.java:737)
>>        at
>> org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.getMarkup(DefaultMarkupSourcingStrategy.java:83)
>>        at
>> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:448)
>>        at org.apache.wicket.Component.getMarkup(Component.java:737)
>>        at org.apache.wicket.Component.getMarkupTag(Component.java:1422)
>>        at
>> org.apache.wicket.Component.getMarkupIdFromMarkup(Component.java:777)
>>        at org.apache.wicket.Component.getMarkupIdImpl(Component.java:1479)
>>        at org.apache.wicket.Component.getMarkupId(Component.java:1525)
>>        at org.apache.wicket.Component.getMarkupId(Component.java:1587)
>>        at
>> org.apache.wicket.markup.html.form.Form.appendDefaultButtonField(Form.java:1096)
>>        at
>> org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1575)
>>        at
>> org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
>>        at
>> org.apache.wicket.Component.internalRenderComponent(Component.java:2551)
>>        ... 51 more
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket page has a redirect loop

2012-06-01 Thread Thomas Götz
Hm, put a breakpoint in FragmentMarkupSourcingStrategy.java:143 and see what 
causes the NullPointerException.

   -Tom


On 01.06.2012 at 19:08 paulstar wrote:

> Caused by: java.lang.NullPointerException
>at
> org.apache.wicket.markup.html.panel.FragmentMarkupSourcingStrategy.getMarkup(FragmentMarkupSourcingStrategy.java:143)
>at
> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:448)
>at org.apache.wicket.Component.getMarkup(Component.java:737)
>at
> org.apache.wicket.markup.html.list.ListView.getMarkup(ListView.java:662)
>at org.apache.wicket.Component.getMarkup(Component.java:737)
>at
> org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.getMarkup(DefaultMarkupSourcingStrategy.java:83)
>at
> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:448)
>at org.apache.wicket.Component.getMarkup(Component.java:737)
>at org.apache.wicket.Component.getMarkupTag(Component.java:1422)
>at
> org.apache.wicket.Component.getMarkupIdFromMarkup(Component.java:777)
>at org.apache.wicket.Component.getMarkupIdImpl(Component.java:1479)
>at org.apache.wicket.Component.getMarkupId(Component.java:1525)
>at org.apache.wicket.Component.getMarkupId(Component.java:1587)
>at
> org.apache.wicket.markup.html.form.Form.appendDefaultButtonField(Form.java:1096)
>at
> org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1575)
>at
> org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
>at
> org.apache.wicket.Component.internalRenderComponent(Component.java:2551)
>... 51 more

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org