There are two very easy ways of doing this, neither of which require any javascript or client side coding.
Method one: Member variable
This is the most straight forward technique where you add a member variable to the PageBean and in your Command Handler access the variable directly.
To use this technique:
Add a member variable to your Page Bean and a public getter/setter
Bind the Value property of the Drop Down control to the member variable.
Method two: Control Accessor
This method removes the need for creating a member variable, but you need to cast the result of a method call to your data type.
To use this technique:
In the CAF Page Editor, right click on the Drop Down Control and choose Source → Create Control Accessor. This will create a new java method.
In your Command Handler function, call the getter that was created in step one and call getValue()
Please see the attached project for a demonstration of both techniques.
Regards,
–mark DropDownValue.zip (11.8 KB)