Creating/modifying a JSF View's components using JavaScript is a very tricky thing to do. However, if you just need stuff like that for a single page, you can forgo JSF and use jQuery to build up a vanilla
JSP that way.
Since JSF session-scope beans are exactly the same thing as ordinary
J2EE session-scope beans (except that JSF builds them automatically), you can use session objects to pass data to/from the JSP to the JSF parts of the app.
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.