TheCoder4eu / BootsFaces-OSP

BootsFaces - Open Source Project
Apache License 2.0
246 stars 102 forks source link

Execute JavaScript from bean action #1060

Closed jepsar closed 5 years ago

jepsar commented 5 years ago

Not sure if this already possible, so this is either a question or a feature request. I would like to execute JavaScript form a bean action. For now I'm using the oncomplete attribute of the button, but that requires me to use b:fetchBeanInfos and wrap the code in if(!validationFailed){...}.

PrimeFaces equivalent:

PrimeFaces.current().executeScript("alert('fiets');");

OmniFaces:

Ajax.oncomplete("alert('fiets');");
geopossachs commented 5 years ago

Does something speak against using the existing functions of PrimeFaces or OmniFaces?

BootsFaces understands itself only as a supplement and recommends their use also

"Many people are using PrimeFaces together with BootsFaces. A common strategy is to use BootsFaces to benefit from the layout, and to add PrimeFaces because it has some very advanced widgets." https://showcase.bootsfaces.net/integration/PrimeFaces.jsf

"Current JSF frameworks strengths are mainly they are offering developers lots of rich Components or Widgets. Instead, BootsFaces tries to start from the pillars, focusing first on the page structure and layout: the main goal is helping developers to obtain well-designed and lightweight Websites with little effort." https://www.bootsfaces.net/

stephanrauh commented 5 years ago

My recommendation is to use the solution provided by OmniFaces.