You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Emond Papegaaij (JIRA)" <my...@incubator.apache.org> on 2005/07/08 09:05:10 UTC

[jira] Commented: (MYFACES-310) HtmlLinkRendererBase does not work with custom components that do not extend HtmlCommandLink

    [ http://issues.apache.org/jira/browse/MYFACES-310?page=comments#action_12315280 ] 

Emond Papegaaij commented on MYFACES-310:
-----------------------------------------

According to the docs of getAttributes(), the check 'component instanceof HtmlCommandLink' is not even needed, because getAttributes().get(HTML.TARGET_ATTR) should return the value of getTarget(), when such a propertie exists. This means the first and second call are equivalent, and therefore the if needless. Just using the second should work in all cases, for all components.

> HtmlLinkRendererBase does not work with custom components that do not extend HtmlCommandLink
> --------------------------------------------------------------------------------------------
>
>          Key: MYFACES-310
>          URL: http://issues.apache.org/jira/browse/MYFACES-310
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Steven Oglesby
>     Priority: Blocker
>  Attachments: log.txt
>
> HtmlLinkRendererBase does not work with custom components that do not extend HtmlCommandLink since it casts to this class at line 323 in method renderJavaScriptAnchorStart.
> i.e.
>  String target = ((HtmlCommandLink)component).getTarget();
> Other similar casting operations are done as follows:
>  String target = null;
>  if (component instanceof HtmlCommandLink) {
>    target = ((HtmlCommandLink)component).getTarget();}
>  else {
>    target = (String)component.getAttributes().get(HTML.TARGET_ATTR);}
> Which looks as if it would solve this problem.

-- 
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