You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2011/09/01 11:10:10 UTC

[jira] [Created] (WICKET-4016) MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor

MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor
------------------------------------------------------------------------------------------------------------------

                 Key: WICKET-4016
                 URL: https://issues.apache.org/jira/browse/WICKET-4016
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5-RC7
            Reporter: Martin Grigorov


org.apache.wicket.MarkupContainer.toString(boolean) uses "if (getMarkup() != null)" to decide whether to write something for the markup but since recently Component#getMarkup() throws MarkupNotFoundException when there is no markup and doesn't return null.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4016) MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13095193#comment-13095193 ] 

Martin Grigorov commented on WICKET-4016:
-----------------------------------------

I suggest to move the entry for markup from MarkupContainer.toString(boolean) to Component.toString(boolean) and use 'markup' variable directly.

> MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4016
>                 URL: https://issues.apache.org/jira/browse/WICKET-4016
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC7
>            Reporter: Martin Grigorov
>
> org.apache.wicket.MarkupContainer.toString(boolean) uses "if (getMarkup() != null)" to decide whether to write something for the markup but since recently Component#getMarkup() throws MarkupNotFoundException when there is no markup and doesn't return null.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4016) MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor

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

Andrea Del Bene updated WICKET-4016:
------------------------------------

    Attachment: toStringComponentPatch.txt

> MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4016
>                 URL: https://issues.apache.org/jira/browse/WICKET-4016
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC7
>            Reporter: Martin Grigorov
>         Attachments: toStringComponentPatch.txt
>
>
> org.apache.wicket.MarkupContainer.toString(boolean) uses "if (getMarkup() != null)" to decide whether to write something for the markup but since recently Component#getMarkup() throws MarkupNotFoundException when there is no markup and doesn't return null.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4016) MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor

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

Martin Grigorov resolved WICKET-4016.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.1
         Assignee: Martin Grigorov

Thanks Andrea!
I extended even more your patch + a test.

> MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4016
>                 URL: https://issues.apache.org/jira/browse/WICKET-4016
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC7
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>             Fix For: 1.5.1
>
>         Attachments: toStringComponentPatch.txt
>
>
> org.apache.wicket.MarkupContainer.toString(boolean) uses "if (getMarkup() != null)" to decide whether to write something for the markup but since recently Component#getMarkup() throws MarkupNotFoundException when there is no markup and doesn't return null.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4016) MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13095192#comment-13095192 ] 

Martin Grigorov commented on WICKET-4016:
-----------------------------------------

The stack trace:

Caused by: org.apache.wicket.markup.MarkupNotFoundException: Can not determine Markup. Component is not yet connected to a parent. [WebMarkupContainer [Component id = c1]]
	at org.apache.wicket.Component.getMarkup(Component.java:731)
	at org.apache.wicket.MarkupContainer.toString(MarkupContainer.java:867)
	at org.apache.wicket.Component.<init>(Component.java:678)
	at org.apache.wicket.MarkupContainer.<init>(MarkupContainer.java:118)
	at org.apache.wicket.markup.html.WebMarkupContainer.<init>(WebMarkupContainer.java:49)
	at org.apache.wicket.markup.html.WebMarkupContainer.<init>(WebMarkupContainer.java:41)
	at com.mycompany.HomePage.<init>(HomePage.java:17)
...

> MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4016
>                 URL: https://issues.apache.org/jira/browse/WICKET-4016
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC7
>            Reporter: Martin Grigorov
>
> org.apache.wicket.MarkupContainer.toString(boolean) uses "if (getMarkup() != null)" to decide whether to write something for the markup but since recently Component#getMarkup() throws MarkupNotFoundException when there is no markup and doesn't return null.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4016) MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100469#comment-13100469 ] 

Andrea Del Bene commented on WICKET-4016:
-----------------------------------------

+1 for going with the proposed solution. I attach a possible patch.

> MarkupContainer.toString(true) fails with MarkupNotFoundException if the call is made in the component constructor
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4016
>                 URL: https://issues.apache.org/jira/browse/WICKET-4016
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC7
>            Reporter: Martin Grigorov
>         Attachments: toStringComponentPatch.txt
>
>
> org.apache.wicket.MarkupContainer.toString(boolean) uses "if (getMarkup() != null)" to decide whether to write something for the markup but since recently Component#getMarkup() throws MarkupNotFoundException when there is no markup and doesn't return null.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira