Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tandraschko committed Feb 22, 2018
1 parent aa0bef9 commit 198910e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Expand Up @@ -38,8 +38,36 @@ public String getDefaultEventName() {
return DEFAULT_EVENT;
}

public boolean isContentLoad(FacesContext context) {
public boolean isContentLoadRequest(FacesContext context) {
String clientId = this.getClientId(context);

return context.getExternalContext().getRequestParameterMap().containsKey(clientId + "_load");
}

@Override
public void processDecodes(FacesContext context) {
if (shouldSkipChildren(context)) {
this.decode(context);
}
else {
super.processDecodes(context);
}
}

@Override
public void processValidators(FacesContext context) {
if (!shouldSkipChildren(context)) {
super.processValidators(context);
}
}

@Override
public void processUpdates(FacesContext context) {
if (!shouldSkipChildren(context)) {
super.processUpdates(context);
}
}

private boolean shouldSkipChildren(FacesContext context) {
return isContentLoadRequest(context);
}
Expand Up @@ -36,7 +36,7 @@ public class OutputPanelRenderer extends CoreRenderer {
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
OutputPanel panel = (OutputPanel) component;

if (panel.isContentLoad(context)) {
if (panel.isContentLoadRequest(context)) {
renderChildren(context, panel);
}
else {
Expand Down

0 comments on commit 198910e

Please sign in to comment.