Closed jepsar closed 4 years ago
@melloware do you have an idea how we could load the Javascript? I don't want to introduce a new component, just the renderer.
One option I see is to make it part of the documentation that you should load some (the PFE core?) Javascript if you want to use the renderer.
Why don't you write JS code inline?
I don't know the spec but are we not allowed to use ResourceDependencies on Renderer's?
@ResourceDependencies({
@ResourceDependency(library = "primefaces", name = "jquery/jquery.js"),
})
Because it would be nice just to have it in primefaces-extensions core.js so its not inline on the page and it gets compressed and cached.
@Rapster I'd like to keep the outputted bytes to a minimum. But inline JS would be an option.
@melloware I think we are too late in the renderer to add resources.
If you don't go on inline route then, you'll have to create a CommandButtonSingleClick
component which only set a new @ResourceDependency
OK understood. that would be my preference vs inlining? @Rapster have any angst about that?
Plus it would allow for prototype overriding in JS if someone wanted to do something special or different in these methods as an added bonus.
No, I have nothing against it but I think inline JS would be simpler:
"PF(" + ((CommandButton) component).getWidgetVar() + ").enable();";
@jepsar Regarding confirmation, not sure why there is a special case on this, but you could use Confirmable#requiresConfirmation
instead
We don't need an exception on the buttons that require confirmation, but the confirmation buttons (the ones in the dialog).
I tested this morning with PrimeFaces.CSP = true and everything works great with this feature with Content Security Policy enabled.
See https://github.com/primefaces/primefaces/issues/2521