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)" <de...@tapestry.apache.org> on 2007/09/29 17:56:51 UTC
[jira] Closed: (TAPESTRY-1709) Radio component throws an exception
when used with RadioGroup and Label
[ https://issues.apache.org/jira/browse/TAPESTRY-1709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAPESTRY-1709.
------------------------------------------
Resolution: Fixed
Fix Version/s: 5.0.6
> Radio component throws an exception when used with RadioGroup and Label
> -----------------------------------------------------------------------
>
> Key: TAPESTRY-1709
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1709
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.0.5
> Reporter: Nick Westgate
> Assignee: Howard M. Lewis Ship
> Fix For: 5.0.6
>
> Attachments: TAPESTRY-1709.patch
>
>
> Example code that breaks:
> <t:RadioGroup t:id="group1">
> <t:Radio t:id="radio1" t:value="value1"/><t:Label for="radio1"/>
> </t:RadioGroup>
> Exception is:
> No object of type org.apache.tapestry.RadioContainer is available from the Environment.
> The reason is that the Label validation rendering calls Radio.getElementName() after the RadioGroup has been popped from the environment.
> A simple fix is to cache the element name:
> private String _elementName;
> ...
> public String getElementName()
> {
> return _elementName;
> }
> ...
> void beginRender(MarkupWriter writer)
> {
> ...
> _elementName = _container.getElementName();
> writer.element("input", "type", "radio", "id", _clientId, "name", _elementName, "value", value);
> ...
> }
> Cheers,
> Nick.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org