Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5488: non-action ajax event shouldn't trigger action event #5502

Merged
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 @@ -171,29 +171,17 @@ public void encodeEnd(FacesContext context, UIComponent component) throws IOExce
*/
private static boolean wasClicked(FacesContext context, UIComponent component, String clientId) {

// Was our command the one that caused this submission?
// we don' have to worry about getting the value from request parameter
// because we just need to know if this command caused the submission. We
// can get the command name by calling currentValue. This way we can
// get around the IE bug.

if (clientId == null) {
clientId = component.getClientId(context);
}

if (context.getPartialViewContext().isAjaxRequest()) {
return BEHAVIOR_SOURCE_PARAM.getValue(context).equals(clientId);
return RenderKitUtils.isPartialOrBehaviorAction(context, clientId);
} else {
Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();

if (requestParameterMap.get(clientId) == null) {

// Check to see whether we've got an action event
// as a result of a partial/behavior postback.
if (RenderKitUtils.isPartialOrBehaviorAction(context, clientId)) {
return true;
}

// Check to see whether we've got an action event from button of type="image"
StringBuilder builder = new StringBuilder(clientId);
String xValue = builder.append(".x").toString();
builder.setLength(clientId.length());
Expand Down
Loading