-
Notifications
You must be signed in to change notification settings - Fork 743
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 #11421: Ignore ColumnRenderer helper in components using columns #11805
Conversation
also i didn't know if "Stateless" was the right term since this is removing a value from the State map... |
i like this more actually but it wraps IOException into FacesException, which can have drawbacks on exception handling propably |
Not sure about the name, but the try/catch and the return null doesn't look nice... Use a |
@Rapster can you give an example of how that would work? I have only use Runnable's for threading not just for a lambda wrapper? |
You can use Runnable just like any other functional interfaces public static <E extends Throwable> void runInRequestScope(FacesContext context, String var, Object value, FailableRunnable<E> runnable) throws E {
// if no var passed just execute the callback
if (LangUtils.isBlank(var)) {
runnable.run();
return;
}
Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
Object oldValue = requestMap.put(var, value);
try {
runnable.run();
}
finally {
if (oldValue != null) {
requestMap.put(var, oldValue);
}
}
} |
OK @Rapster i think I got it if you want to re-review |
primefaces/src/main/java/org/primefaces/component/autocomplete/AutoCompleteRenderer.java
Outdated
Show resolved
Hide resolved
primefaces/src/main/java/org/primefaces/util/ComponentUtils.java
Outdated
Show resolved
Hide resolved
primefaces/src/main/java/org/primefaces/util/FailableRunnable.java
Outdated
Show resolved
Hide resolved
5e7d8fc
to
34c099f
Compare
why not just a callbacks package? thats the more common way |
As they're just extension of java.util, it makes sense to keep them in org.primefaces.util. I don't like having a deep and wide package structure, it always end up having a mess: the flatter the better. Callbacks at this point is just a container, but could become what One may argue how cumbersome it is to do someting like |
all right, thats ok for me static imports are even more mess in the most times, so lets better stay with it |
so I am OK to merge this?? I am very happy with this PR with @Rapster help where we landed on this! |
@Rapster how about |
i'm fine with that |
not sure about the name |
I changed it to |
Fix #11421: Ignore ColumnRenderer helper in components using columns
This PR does it the "better" way with a utility to wrap and restored the helper. Note we need to do this on all components that have custom "Column Rendering".