henningn commented on code in PR #6031: URL: https://github.com/apache/myfaces-tobago/pull/6031#discussion_r1955712806
########## tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommand.java: ########## @@ -74,4 +70,34 @@ public String getFieldId(final FacesContext facesContext) { return getClientId(facesContext); } } + private static class ParentOfCommandVisitor implements VisitCallback { + private boolean parentOfCommands = false; + private final FacesContext facesContext; + private final String clientId; + + private ParentOfCommandVisitor(FacesContext facesContext, String clientId) { + this.facesContext = facesContext; + this.clientId = clientId; + } + + @Override + public VisitResult visit(VisitContext context, UIComponent target) { + if (!target.getClientId(facesContext).equals(clientId) + && (target instanceof Visual && !((Visual) target).isPlain() + || target.getRendererType() != null && target.getRendererType().startsWith("jakarta.faces"))) { Review Comment: Shouldn't the render type start with "javax.faces" instead of "jakarta.faces"? ########## tobago-example/tobago-example-demo/src/main/webapp/content/900-test/2300-link/Link.xhtml: ########## @@ -19,13 +19,19 @@ <ui:composition template="/main.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:tc="http://myfaces.apache.org/tobago/component" - xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:f="http://xmlns.jcp.org/jsf/core"> + xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> <tc:link id="aLink" label="a.link" link="https://www.apache.org/"> <tc:style width="200px"/> </tc:link> <br/> <tc:link id="buttonLink" label="button.link"> <tc:style width="200px"/> </tc:link> + + <tc:link id="dropdownRepeat" label="Dropdown with ui:repeat" omit="true"> + <tc:style customClass="icon-button"/> + <ui:repeat var="river" value="#{forEachController.rivers}"> + <tc:link id="#{river.name}" label="#{river.name}" omit="true"/> Review Comment: id="#{river.name}" has to be removed, to avoid a IllegalArgumentException: "component identifier must not be a zero-length String". In Tobago 6 the river.name-id of the tc:link is also ignored but instead of an empty string a generated id is set. This seems to be another issue. ########## tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java: ########## @@ -284,4 +267,64 @@ protected CssItem[] getCssItems(final FacesContext facesContext, final T command protected void encodeBadge(final FacesContext facesContext, final T command) throws IOException { } + + private class RenderChildrenCommands implements VisitCallback { + private List<UIComponent> renderLater = null; + private final FacesContext facesContext; + private final TobagoResponseWriter writer; + private final String clientId; + + private RenderChildrenCommands(FacesContext context, TobagoResponseWriter writer, String clientId) { + this.facesContext = context; + this.writer = writer; + this.clientId = clientId; + } + + @Override + public VisitResult visit(VisitContext context, UIComponent target) { + if (target.getClientId(facesContext).equals(clientId)) { + return VisitResult.ACCEPT; + } else if (target instanceof AbstractUIStyle) { + if (renderLater == null) { + renderLater = new ArrayList<>(); + } + renderLater.add(target); + return VisitResult.REJECT; + } else if (target instanceof Visual && !((Visual) target).isPlain() + || target.getRendererType() != null && target.getRendererType().startsWith("jakarta.faces")) { Review Comment: Replace "jakarta.faces" with "javax.faces" -- 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-unsubscr...@myfaces.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org