You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Thomas Singer (JIRA)" <ji...@apache.org> on 2007/05/26 22:59:16 UTC

[jira] Created: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

A fragment will not be found when it is nested, e.g., in a border
-----------------------------------------------------------------

                 Key: WICKET-592
                 URL: https://issues.apache.org/jira/browse/WICKET-592
             Project: Wicket
          Issue Type: Bug
    Affects Versions: 1.2.6
            Reporter: Thomas Singer
             Fix For: 1.2.7


sketched markup:

 <div wicket:id="myBorder">
   ...
   <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
   ...
   <tr wicket:id="fragmentTarget">...</tr>
 </div>

Following components were added to the page:

  MyBorder border = new MyBorder("myBorder");
  border.add(new Fragment("fragmentTarget", "fragmentSource"));
  this.add(border);

It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505759 ] 

Alastair Maw commented on WICKET-592:
-------------------------------------

Why can't you just put your <wicket:fragment> markup at the same level in the HTML as the border component?

> A fragment will not be found when it is nested, e.g., in a border
> -----------------------------------------------------------------
>
>                 Key: WICKET-592
>                 URL: https://issues.apache.org/jira/browse/WICKET-592
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>            Reporter: Thomas Singer
>            Assignee: Juergen Donnerstag
>             Fix For: 1.2.7
>
>
> sketched markup:
>  <div wicket:id="myBorder">
>    ...
>    <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
>    ...
>    <tr wicket:id="fragmentTarget">...</tr>
>  </div>
> Following components were added to the page:
>   MyBorder border = new MyBorder("myBorder");
>   border.add(new Fragment("fragmentTarget", "fragmentSource"));
>   this.add(border);
> It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

Posted by "Thomas Singer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500132 ] 

Thomas Singer commented on WICKET-592:
--------------------------------------

Do you need a concrete example to reproduce? For now, I can't use Fragments in valid HTML because all our pages make use of a Border.

> A fragment will not be found when it is nested, e.g., in a border
> -----------------------------------------------------------------
>
>                 Key: WICKET-592
>                 URL: https://issues.apache.org/jira/browse/WICKET-592
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>            Reporter: Thomas Singer
>             Fix For: 1.2.7
>
>
> sketched markup:
>  <div wicket:id="myBorder">
>    ...
>    <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
>    ...
>    <tr wicket:id="fragmentTarget">...</tr>
>  </div>
> Following components were added to the page:
>   MyBorder border = new MyBorder("myBorder");
>   border.add(new Fragment("fragmentTarget", "fragmentSource"));
>   this.add(border);
> It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507939 ] 

Juergen Donnerstag commented on WICKET-592:
-------------------------------------------

Development is currently focussed on 1.3 and to get 1.3 out soon. Which is why we are only fixing realy critical bugs in 1.2.x.  I understand that a workaround is available for 1.2.6 which is why I lean towards not fixig it in 1.2.6. In case you can live with that, I'd appreciate you closing the entry. Thanks.

Juergen

> A fragment will not be found when it is nested, e.g., in a border
> -----------------------------------------------------------------
>
>                 Key: WICKET-592
>                 URL: https://issues.apache.org/jira/browse/WICKET-592
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>            Reporter: Thomas Singer
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.0-rc1
>
>         Attachments: src.zip
>
>
> sketched markup:
>  <div wicket:id="myBorder">
>    ...
>    <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
>    ...
>    <tr wicket:id="fragmentTarget">...</tr>
>  </div>
> Following components were added to the page:
>   MyBorder border = new MyBorder("myBorder");
>   border.add(new Fragment("fragmentTarget", "fragmentSource"));
>   this.add(border);
> It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-592:
------------------------------------

    Assignee: Juergen Donnerstag

> A fragment will not be found when it is nested, e.g., in a border
> -----------------------------------------------------------------
>
>                 Key: WICKET-592
>                 URL: https://issues.apache.org/jira/browse/WICKET-592
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>            Reporter: Thomas Singer
>            Assignee: Juergen Donnerstag
>             Fix For: 1.2.7
>
>
> sketched markup:
>  <div wicket:id="myBorder">
>    ...
>    <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
>    ...
>    <tr wicket:id="fragmentTarget">...</tr>
>  </div>
> Following components were added to the page:
>   MyBorder border = new MyBorder("myBorder");
>   border.add(new Fragment("fragmentTarget", "fragmentSource"));
>   this.add(border);
> It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

Posted by "Thomas Singer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508095 ] 

Thomas Singer commented on WICKET-592:
--------------------------------------

It would help, if you could verify this bug in 1.2.6 and verify it is fixed for the same example in 1.3*.

> A fragment will not be found when it is nested, e.g., in a border
> -----------------------------------------------------------------
>
>                 Key: WICKET-592
>                 URL: https://issues.apache.org/jira/browse/WICKET-592
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>            Reporter: Thomas Singer
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.0-rc1
>
>         Attachments: src.zip
>
>
> sketched markup:
>  <div wicket:id="myBorder">
>    ...
>    <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
>    ...
>    <tr wicket:id="fragmentTarget">...</tr>
>  </div>
> Following components were added to the page:
>   MyBorder border = new MyBorder("myBorder");
>   border.add(new Fragment("fragmentTarget", "fragmentSource"));
>   this.add(border);
> It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

Posted by "Thomas Singer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Singer updated WICKET-592:
---------------------------------

    Attachment: src.zip

Please try the attached project with Wicket 1.2.6. I'm getting following exception:

wicket.markup.MarkupException: Markup does not contain a fragment with id=fragmentDeclaration; Component: [MarkupContainer [Component id = fragmentUsage, page = pages.Home, path = 0:border:fragmentUsage.Fragment, isVisible = true, isVersioned = true]]
     at wicket.markup.html.panel.Fragment.renderFragment(Fragment.java:241)
     at wicket.markup.html.panel.Fragment.onComponentTagBody(Fragment.java:200)
     at wicket.Component.renderComponent(Component.java:1712)
     at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
     at wicket.Component.render(Component.java:1526)
     at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
     at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
     at wicket.markup.html.border.Border.renderBodyComponent(Border.java:300)
     at wicket.markup.html.border.Border.resolve(Border.java:215)
     at wicket.MarkupContainer.renderNext(MarkupContainer.java:1345)
     at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
     at wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:571)
     at wicket.markup.html.border.Border.onComponentTagBody(Border.java:244)
     at wicket.Component.renderComponent(Component.java:1712)
     at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
     at wicket.Component.render(Component.java:1526)
     at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
     at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
     at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)
     at wicket.Component.renderComponent(Component.java:1712)
     at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
     at wicket.Component.render(Component.java:1526)
     at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
     at wicket.MarkupContainer.renderAll(MarkupContainer.java:944)
     at wicket.Page.onRender(Page.java:860)
     at wicket.Component.render(Component.java:1526)
     at wicket.Page.renderPage(Page.java:408)
     at wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:226)
     at wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
     at wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
     at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902)
     at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
     at wicket.RequestCycle.step(RequestCycle.java:1010)
     at wicket.RequestCycle.steps(RequestCycle.java:1084)
     at wicket.RequestCycle.request(RequestCycle.java:454)
     at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
     at java.lang.Thread.run(Thread.java:595)

> A fragment will not be found when it is nested, e.g., in a border
> -----------------------------------------------------------------
>
>                 Key: WICKET-592
>                 URL: https://issues.apache.org/jira/browse/WICKET-592
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>            Reporter: Thomas Singer
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.0-rc1
>
>         Attachments: src.zip
>
>
> sketched markup:
>  <div wicket:id="myBorder">
>    ...
>    <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
>    ...
>    <tr wicket:id="fragmentTarget">...</tr>
>  </div>
> Following components were added to the page:
>   MyBorder border = new MyBorder("myBorder");
>   border.add(new Fragment("fragmentTarget", "fragmentSource"));
>   this.add(border);
> It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-592.
---------------------------------------

       Resolution: Invalid
    Fix Version/s:     (was: 1.2.7)
                   1.3.0-rc1

For me it is working. I even used the example you provided. A typical source of error is that with "new Fragment(arg1, arg2)" the two arguments are mixed up.

Please see BoxBorderTestPage_9

---- JAVA

	public BoxBorderTestPage_9()
	{
		Border myBorder = new BorderComponent1("myBorder");
		add(myBorder);

		Fragment panel1 = new Fragment("fragmentsWillBeRenderedHere", "fragmentSource");
		myBorder.add(panel1);
	}

---- MARKUP

<html>
<body>
<div wicket:id="myBorder">
  <table>
    <wicket:fragment wicket:id="fragmentSource">
      <tr>
       <td>Hello world</td>
      </tr>
    </wicket:fragment>
   ...
    <tr wicket:id="fragmentsWillBeRenderedHere">...</tr>
  </table>
</div> 
</body>
</html>

---- OUTPUT

<html>
<body>
<div wicket:id="myBorder"><wicket:border>
<!-- with open-close tag -->
davor <wicket:body>
  <table>
    
   ...
    <tr wicket:id="fragmentsWillBeRenderedHere">
      <tr>
       <td>Hello world</td>
      </tr>
    </tr>
  </table>
</wicket:body> danach
</wicket:border></div> 
</body>
</html>
 ----

> A fragment will not be found when it is nested, e.g., in a border
> -----------------------------------------------------------------
>
>                 Key: WICKET-592
>                 URL: https://issues.apache.org/jira/browse/WICKET-592
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>            Reporter: Thomas Singer
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.0-rc1
>
>
> sketched markup:
>  <div wicket:id="myBorder">
>    ...
>    <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
>    ...
>    <tr wicket:id="fragmentTarget">...</tr>
>  </div>
> Following components were added to the page:
>   MyBorder border = new MyBorder("myBorder");
>   border.add(new Fragment("fragmentTarget", "fragmentSource"));
>   this.add(border);
> It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-592) A fragment will not be found when it is nested, e.g., in a border

Posted by "Thomas Singer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505781 ] 

Thomas Singer commented on WICKET-592:
--------------------------------------

1. We want to render a table with different kind of rows. It seems natural to me to put them in-place 


<div wicket:id="myBorder"> 
  <table>
    <wicket:fragment wicket:id="fragmentSource">
      <tr>
       <td>Hello world</td>
      </tr>
    </wicket:fragment> 
   ... 
    <tr wicket:id="fragmentsWillBeRenderedHere">...</tr> 
  </table>
 </div>

2. Of course I could place the fragments below the </div>-border-tag, but then there either would be invalid HTML (<tr> without surrounding <table>) or it would cause an empty <table> tag when rendering (when surrounding the <tr-fragments> with the <table> tag)
3. This would not solve the problem in Wicket - it just would be a work-around.


> A fragment will not be found when it is nested, e.g., in a border
> -----------------------------------------------------------------
>
>                 Key: WICKET-592
>                 URL: https://issues.apache.org/jira/browse/WICKET-592
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.2.6
>            Reporter: Thomas Singer
>            Assignee: Juergen Donnerstag
>             Fix For: 1.2.7
>
>
> sketched markup:
>  <div wicket:id="myBorder">
>    ...
>    <wicket:fragment wicket:id="fragmentSource">...</wicket:fragment>
>    ...
>    <tr wicket:id="fragmentTarget">...</tr>
>  </div>
> Following components were added to the page:
>   MyBorder border = new MyBorder("myBorder");
>   border.add(new Fragment("fragmentTarget", "fragmentSource"));
>   this.add(border);
> It always cannot find the "fragmentSource". After debugging the Fragment's renderFragment() method, I guess it is caused by the method call providerMarkupStream.findComponentIndex(null, markupId), because the componentMap in Markup contains no "fragmentSource", but only "myBorder:fragmentSource".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.