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

Fixes #5316 - ClientWindow: Custom PrimeClientWindowFactory not being respected #5322

Merged
merged 1 commit into from
Oct 1, 2023
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
28 changes: 0 additions & 28 deletions impl/src/main/java/com/sun/faces/lifecycle/LifecycleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,46 +66,18 @@ public class LifecycleImpl extends Lifecycle {

// List for registered PhaseListeners
private List<PhaseListener> listeners = new CopyOnWriteArrayList<>();
private boolean isClientWindowEnabled = false;
private WebConfiguration config;

public LifecycleImpl() {

}

public LifecycleImpl(FacesContext context) {
ExternalContext extContext = context.getExternalContext();
config = WebConfiguration.getInstance(extContext);
context.getApplication().subscribeToEvent(PostConstructApplicationEvent.class, Application.class, new PostConstructApplicationListener());

}

private class PostConstructApplicationListener implements SystemEventListener {

@Override
public boolean isListenerForSource(Object source) {
return source instanceof Application;
}

@Override
public void processEvent(SystemEvent event) throws AbortProcessingException {
postConstructApplicationInitialization();
}

}

private void postConstructApplicationInitialization() {
String optionValue = config.getOptionValue(WebConfiguration.WebContextInitParameter.ClientWindowMode);
isClientWindowEnabled = null != optionValue && !optionValue.equals(WebConfiguration.WebContextInitParameter.ClientWindowMode.getDefaultValue());
}

// ------------------------------------------------------- Lifecycle Methods

@Override
public void attachWindow(FacesContext context) {
if (!isClientWindowEnabled) {
return;
}
if (context == null) {
throw new NullPointerException(MessageUtils.getExceptionMessageString(MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "context"));
}
Expand Down
Loading