Skip to content

Commit

Permalink
Merge pull request #5502 from eclipse-ee4j/mojarra_issue_5488_non_act…
Browse files Browse the repository at this point in the history
…ion_ajax_event_should_not_trigger_action_event

Fix #5488: non-action ajax event shouldn't trigger action event
  • Loading branch information
BalusC committed Sep 7, 2024
2 parents e463906 + c5143e7 commit 4afe7fb
Showing 1 changed file with 2 additions and 14 deletions.
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

0 comments on commit 4afe7fb

Please sign in to comment.