Volodymyr Siedlecki created MYFACES-4695: --------------------------------------------
Summary: Ajax's render doesn't support nested elements Key: MYFACES-4695 URL: https://issues.apache.org/jira/browse/MYFACES-4695 Project: MyFaces Core Issue Type: Bug Affects Versions: 4.1.0-RC3, 4.0.2, 2.3-next-M8, 3.0.2, 2.3.10 Reporter: Volodymyr Siedlecki The code below doesn't work as expected. The element with id "one" should be updated. Instead, the submit is rendered when pressed. {code:java} <h:body> TEMPLATE <h:form id="cartForm"> CART IS HERE! <h:outputText id="one" value="1" /> <h:outputText id="two" value="2" /> </h:form> <h:form id="shoppingCartForm" name="shoppingCartForm"> <h:commandButton type="submit" value="Update" styleClass="commandExButton" id="updateButton"> <f:ajax execute="@form" render="cartForm:one" /> </h:commandButton> </h:form> </h:body> </f:view> {code} The generated code looks like: {code:java} <input id="shoppingCartForm:updateButton" name="shoppingCartForm:updateButton" type="submit" value="Update" onclick="faces.util.chain(this, event,function(event){myfaces.ab(this,event,'action','@form','shoppingCartForm:updateButton')}); return false;" class="commandExButton"> {code} The ids for the render are the submit button itself: *shoppingCartForm:updateButton* Note: Mojarra works as expected (element one is updated) when I tested the same facelet. Note: 4.1.0-RC3 fails with the following exception (due to [MYFACES-4624|https://github.com/apache/myfaces/commit/304099d4588383424df9105d5a751911c1c5301a]): {code:java} jakarta.servlet.ServletException: Cannot find component for expression "cartForm:one" referenced from "shoppingCartForm:updateButton". at jakarta.faces.webapp.FacesServlet.service(FacesServlet.java:239) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1266) at [internal classes] Caused by: jakarta.faces.component.search.ComponentNotFoundException: Cannot find component for expression "cartForm:one" referenced from "shoppingCartForm:updateButton". at org.apache.myfaces.component.search.SearchExpressionHandlerImpl.resolveClientIds(SearchExpressionHandlerImpl.java:179) at [internal classes] at org.apache.myfaces.renderkit.html.util.AjaxScriptBuilder.appendIds(AjaxScriptBuilder.java:278) at org.apache.myfaces.renderkit.html.util.AjaxScriptBuilder.build(AjaxScriptBuilder.java:205) {code} _____ The solution in my opinion is the let the search in the invokeOnComponent method call continue without regard of the separator character. The parent naming contains would be searched until the id is found (or not). In other words, remove this line: [https://github.com/apache/myfaces/blame/4.1.x/impl/src/main/java/org/apache/myfaces/component/search/SearchExpressionHandlerImpl.java#L538] -- This message was sent by Atlassian Jira (v8.20.10#820010)