You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by GitBox <gi...@apache.org> on 2022/12/19 22:27:02 UTC

[GitHub] [myfaces] melloware commented on pull request #435: Fix MYFACES-4533 - prefix id in name attribute

melloware commented on PR #435:
URL: https://github.com/apache/myfaces/pull/435#issuecomment-1358493401

   Not sure if this matters but mojarra does this in PartialResponseWriter and it doesn't look like MyFaces does?
   
   It looks like it is doing NamingContainer View ID code just thought I would mention it.
   
   ```java
   @Override
       public void startDocument() throws IOException {
           ResponseWriter writer = getWrapped();
           String encoding = writer.getCharacterEncoding( );
           if( encoding == null ) {
               encoding = "utf-8";
           }
           writer.writePreamble("<?xml version='1.0' encoding='" + encoding + "'?>\n");
           writer.startElement("partial-response", null);
           FacesContext ctx = FacesContext.getCurrentInstance();
           if (null != ctx && ctx.getViewRoot() instanceof NamingContainer) {
               String id = ctx.getViewRoot().getContainerClientId(ctx);
               writer.writeAttribute("id", id, "id");
           }
       }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org