You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org> on 2005/09/28 18:32:58 UTC

[jira] Commented: (TAPESTRY-675) AbstractComponent#renderComponent only renders during rewind if contained by form

    [ http://issues.apache.org/jira/browse/TAPESTRY-675?page=comments#action_12330702 ] 

Howard M. Lewis Ship commented on TAPESTRY-675:
-----------------------------------------------

Perhaps what you are seeing is the difference between the action service (for the Form) and the direct service.  Direct service has been the default for several years.  Your T3 application though might have been using the action service.  None of this behavior has changed since Tapestry 2.x.

> AbstractComponent#renderComponent only renders during rewind if contained by form
> ---------------------------------------------------------------------------------
>
>          Key: TAPESTRY-675
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-675
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>     Reporter: Mark Lehmacher
>     Assignee: Howard M. Lewis Ship
>     Priority: Critical

>
> AbstractComponent#renderComponent(IMarkupWriter, IRequestCycle) only renders during rewind if the component is contained by a form (using Tapestry 4 - beta 8). In T3 it always rendered, even during rewind and if not contained by a form.
> I can't imagine that this is wanted behaviour.  Imagine you extend BaseComponent and have a template which contains a form and a PropertySelection component. You might need to build a model for the PropertySelection depending on a parameter which will be passed to your component. The parameter itsself gets initialized through the containing page's pageBeginRender method. That means you can not hook into the component's pageBeginRender method because it renders before the page's one and thus the parameter is still null. That's when I use renderComponent in order to set up my properties.
> I tested with the following (reduced) situation:
> Simple.java:
> public abstract class Simple extends AbstractComponent implements IFormComponent {
> 	private static final Logger logger = Logger.getLogger(Simple.class);
> 	
> 	protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
> 		logger.debug(cycle.isRewinding() ? "rewind" : "render");
> 		writer.print("Hello World");
> 	}
> }
> Simple.jwc:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE component-specification PUBLIC 
>   "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
>   "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
> <component-specification class="de.rwth.rz.mailadm.components.Simple" allow-informal-parameters="no"/>
> Test.html:
> <html>
> <head><title>Tapestry Page Template</title></head>
> <body>
>     <span jwcid="@Simple"/>
>     
>     <span jwcid="@Form">
>        <!-- if you put the Simple component here it rewinds -->
>         <input jwcid="@Submit"/>
>     </span>
>     
> </body>
> </html>
> Test.page:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE page-specification
>     PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
>     "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
> <page-specification class="org.apache.tapestry.html.BasePage"/>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org