Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ public void invokeContextCallback(FacesContext context, UIComponent target)
// At this point if the algorithm hasn't returned and the topExpression does not have any separator char
// we need to do the search backward using findComponent.
if (target == null
&& searchExpressionContext.getSource() == previous
&& (topExpression.indexOf(separatorChar) == -1) )
&& searchExpressionContext.getSource() == previous
&& (topExpression.indexOf(separatorChar + "@") == -1) ) // updated for MYFACES-4695
{
UIComponent baseNC = previous.getNamingContainer();
if (baseNC != null && baseNC.getParent() != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,24 @@ public void testIsPassthroughExpression() throws Exception
Assertions.assertFalse(handler.isPassthroughExpression(searchContextWithAjaxResolve, "@form:@child(0)"));
}

@Test
public void testMyFaces4695() throws Exception
{
startViewRequest("/search2.xhtml");
processLifecycleExecute();
executeBeforeRender();
executeBuildViewCycle();

SearchExpressionContext searchContext =
SearchExpressionContext.createSearchExpressionContext(facesContext, facesContext.getViewRoot().findComponent("form2:submit"));

SearchExpressionHandler handler = facesContext.getApplication().getSearchExpressionHandler();

Assertions.assertEquals("form1:one", handler.resolveClientId(searchContext, "form1:one"));

processRemainingPhases();
}

/*
@Test
public void testCompositeComponentExpression() throws Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
</h:head>
<h:body>
<h:form id="form1">
<h:outputText id="one" value="1" />
<h:outputText id="two" value="2" />
</h:form>
<h:form id="form2">
<h:commandButton type="submit" id="submit">
<f:ajax render="form1:one" />
</h:commandButton>
</h:form>
</h:body>
</html>