Tuesday, April 17, 2012

Working With SelectOneChoice

One of the simpler way to work with selectone choice is as under.

1) In page definition(bindings) create an iterator from view object in executables.
2) In bindings section click on '+' and select table from list. Select the viewobject you want to deal with. Select the attributes you want to reference.
3) Now on you jsf/jsff page write below code for selectonechoice component.
4) No create Managed bean and create variable of type RichSelectOneChoice as: private RichSelectOneChoice deptName;
and generate accessors for it.
5) The selectonechoice in jsff is binded to this variable. Now you can create a button to test the value for this using below code on action
System.out.println(submType.getValue());