While the getComponent().getValue() should work. I have run some speed tests and the getComponent is really inefficient. document1.getValue("yourField") would be way quicker. I know it may not be a big thing but I was using getComponent on a fairly complex XPage and converted them to use the dataSource and the result was pretty impressive. With fast computers and fast networks it is easy to get sloppy.
The first computer I used was a Univac in it's own Air conditioned room with 8K of core memory. Extra clock cycles was a big thing, should still be because they can sure add up.
Anyway, I think that use the getValue (as Paul has aleready suggested) and your code should work, use the datasource and it should work better.