Hi All,
I just grabbed Wicket 1.3.0-beta2 and tried to reproduce this problem.
The problem still occurs.
I managed to isolate it to a simple use case (see the attachments for
Java code and HTML - ZIP attachments get filtered out, so I'm sending
the files as is). It looks like it doesn't have anything to do with
a TabbedPanel. Instead it looks like fragments do not play nicely with
<wicket:message> tags.
Here is the markup for my panel:
<html xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div wicket:id="test">[test fragment goes
here]</div><br />
</wicket:panel>
<wicket:fragment wicket:id="testFrag">
<table class="theader" cellspacing="1">
<tr class="bg">
<th><wicket:message key="message.test">[test
message]</wicket:message> </th>
<td><span wicket:id="label">[test
label]</span> </td>
</tr>
</table>
</wicket:fragment>
</body>
</html>
If I comment out the <wicket:message> tag from my fragment,
everything works fine. However when the <wicket:message> tag is
in place, a MarkupException occurs and the closing tag </div> is
highlighted red (see below).
Do you think this could be a bug in Wicket or is there a problem in my
markup/code?
Thanks!
Huergo
Exception stack trace:
org.apache.wicket.markup.MarkupException: Method renderComponent
called on bad markup element: </div>
[markup =
file:/C:/work/projects/collection/collection-webapp/target/classes/test/FragmentTestPanel.html
<html>
<body>
<wicket:panel>
<div wicket:id="test">[test fragment goes here]</div><br />
</wicket:panel>
<wicket:fragment wicket:id="testFrag">
<table class="theader" cellspacing="1">
<tr class="bg">
<th><wicket:message key="message.test">[test
message]</wicket:message> </th>
<td><span wicket:id="label">[test
label]</span> </td>
</tr>
</table>
</wicket:fragment>
</body>
</html>
, index = 8, current = '</div>' (line 5, column 49)]
at
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:426)
at org.apache.wicket.Component.renderComponent(Component.java:2089)
at
org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60)
at org.apache.wicket.Component.render(Component.java:1941)
at org.apache.wicket.Component.render(Component.java:1904)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:223)
at
org.apache.wicket.markup.resolver.WicketMessageResolver.resolve(WicketMessageResolver.java:103)
at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1206)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1349)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1284)
at
org.apache.wicket.markup.html.panel.Fragment.renderFragment(Fragment.java:268)
at
org.apache.wicket.markup.html.panel.Fragment.onComponentTagBody(Fragment.java:198)
at org.apache.wicket.Component.renderComponent(Component.java:2114)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1294)
at org.apache.wicket.Component.render(Component.java:1941)
at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1179)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1349)
at
org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:629)
at
org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:107)
at org.apache.wicket.Component.renderComponent(Component.java:2114)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1294)
at org.apache.wicket.Component.render(Component.java:1941)
at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1179)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1349)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1284)
at org.apache.wicket.Component.renderComponent(Component.java:2114)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1294)
at org.apache.wicket.Component.render(Component.java:1941)
at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1179)
at
org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1311)
at org.apache.wicket.Page.onRender(Page.java:1422)
at org.apache.wicket.Component.render(Component.java:1941)
at org.apache.wicket.Page.renderPage(Page.java:927)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:225)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1037)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1107)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:257)
at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:126)
Huergo Perez wrote:
I am migrating my application from 1.2.6 to 1.3.0 and am getting a
similar (although slightly different) problem in
1.3.0-incubating-SNAPSHOT.
I'll try to isolate the problem in a small example and follow up.
Regards,
Huergo
Igor Vaynberg wrote:
have you tried against the latest wicket-1.2.x branch?
-igor
On 6/8/07, Huergo
Perez <[EMAIL PROTECTED] >
wrote:
Hi
All,
I am having the following problem trying to use a TabbedPanel inside a
fragment. The structure of components is the following:
[CompanyDetailsPanel] -> [RelatedInfoFragment] -> [TabbedPanel].
Wicket throws a MarkupException complaining about a missing component
ID. The exception message seems to be unrelated to the real cause of
the problem. The component IDs in HTML and the panel's Java code match.
Below the exception stack trace Wicket displays my markup file and
highlights the closing </div> of my fragment.
If I use the TabbedPanel directly from my CompanyDetailsPanel (i.e.
without using a fragment), then everything works fine.
I am using Wicket 1.2.6.
Has anybody faced such a problem? Is it a bug in Wicket? Are there any
workarounds?
Thanks in advance!
Huergo
Markup reported by wicket:
-------------------------
<wicket:panel>
<div wicket:id="generalInfo">[general info]</div><br />
<div wicket:id="bankInfo">[bank info]</div><br />
<div wicket:id="contactInfo">[contact info]</div><br />
<div wicket:id="legalAddress">[legal address]</div><br />
<div wicket:id="primaryAddress">[primary address]</div><br />
<div wicket:id="comments">[comments section]</div><br /> <div wicket:id="relatedInfo">[related info]
</div><br /> ^^^^^^^^^^^
</wicket:panel>
Wicket's exception message:
-------------------------
WicketMessage: Unable to find component with id 'name' in
[MarkupContainer [Component id = relatedInfo, page =
com.xlab.collection.wicket.test.london.CompanyDetailsTestPage, path =
0:companyDetails:relatedInfo.CompanyDetailsPanel$RelatedInfoFragment
, isVisible = true, isVersioned = true]]. This means that you declared
wicket:id=name in your markup, but that you either did not add the
component to your page at all, or that the hierarchy does not match.
[markup =
file:/C:/work/projects/collection/collection-webapp/target/classes/com/xlab/collection/wicket/gui/party/details/CompanyDetailsPanel.html,
index = 177, current = '<span wicket:id="name">' (line 97, column
7)]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
|
[content]
package test;
import org.apache.wicket.markup.html.WebPage;
public class FragmentTestPage extends WebPage {
public FragmentTestPage() {
super();
add(new FragmentTestPanel("content"));
}
}
[test fragment goes here]
package test;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
public class FragmentTestPanel extends Panel {
public FragmentTestPanel(String id) {
super(id);
add(new TestFragment("test"));
}
private class TestFragment extends Fragment {
public TestFragment(String id) {
super(id, "testFrag", FragmentTestPanel.this);
add(new Label("label", "Hello!"));
}
}
}
message.test=Test message
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user