myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeanne Waldman <jeanne.wald...@oracle.com>
Subject [Trinidad] LinkRenderer calls writeURIAttribute for id... but why?
Date Wed, 16 Apr 2008 16:03:21 GMT
forgot to add [Trinidad] to the subject.

Jeanne Waldman wrote, On 4/15/2008 3:14 PM PT:
> Hi there,
>
> I'm wondering if anyone knows why the links id needs to call 
> writeURIAttribute instead of writeAttribute.
>
> The code is in GoLinkRenderer. The comment says that they are URI 
> attributes, but it doesn't say why. I have some of my own code that 
> does the same thing for links , but it causes a problem if the id is 
> non-ascii, like Japanese. I can fix this issue by calling 
> writeAttribute, but I don't want to cause other problems that I'm just 
> not aware of.
> Thanks for any insights!!
> - Jeanne
>
>
>  /**
>   * Renders the client ID as both "id" and "name"
>   */
>  @Override
>  protected void renderId(
>    FacesContext context,
>    UIComponent  component) throws IOException
>  {
>    if (shouldRenderId(context, component))
>    {
>      String clientId = getClientId(context, component);
>      // For links, these are actually URI attributes
>      context.getResponseWriter().writeURIAttribute("id", clientId, "id");
>      context.getResponseWriter().writeURIAttribute("name", clientId, 
> "id");
>    }
>  }
>
>
>

Mime
View raw message