I don't see anything obvious, although if your localhost execution is managed by your
IDE and your remote execution is not, that would be a starting point. Also consider changing
to
For one thing, if I'm not mistaken, the oncomplete method is working in JavaScript mode and that means that the page element IDs must be their true, absolute IDs as generated by the
JSF page renderer, not the short IDs that are in the JSF View Template source. Senility keeps me from remembering, but in RichFaces, I think there was a custom RichFaces JavaScript method to assist in that. Maybe PrimeFaces has an equivalent.
Also, "prepararInserir()" is bad form. JSF EL is supposed to be defining a
reference to the Action method that JSF will invoke. It's not supposed to be a direct call by the page. So remove the "()".
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.