Usually a "getWidth/setWidth" on a
JSF component won't work, because attributes such as "width" are set via EL expressions and therefore you have to setup a rather nasty - and mutable - EL processing environment to get the right data in. Just passing a simple number width value isn't enough.
So instead, you would usually be better off setting the width to a backing bean property like so:
Then instead of pushing the width into the component, the component will pull the width from the backing bean.
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.