Monday, August 22, 2011

SelectOneChoice selected value stored in variable

1) In view object define a drop down list for department name (it should display a list of departments).
2) Drag and drop a table attribute(column eg Department name column alone) on a jsff page.
3) Right click on jsff page and select goto page definition. (use this rather than bindings tab)
4) In page definition.xm file goto source tab and find variablesIterator tag. If this tag is not present in design tab in executables region add variablesIterator by click the + sign and creating variable iterator object.
5) In source tab under variableIterator table define a variable name as under:
(lessthansign)variable name="personId" type="oracle.jbo.domain.Number" (greatthansign)
6) Now goto jsff page of page definition inside bindings create one attributeValues binding by clicking + sign. Specify the Datasource as variables and select Attribute name as varDeptId as declared earlier.
7) Now goto page bindings and double click the LOV of department name that you have created in step 2. Select base data source type as variables.
In list datasource select departments view. In data value select the variable and in list attribute select the attribute you want from department column e.g department id and select the display element i.e. the value you want to display on screen.
8) This binding varaible we contain the value you have selected in dropdown list. Your can use JSFUtils to resolve the expression value or assign this value to and execute with paramters operation. The expression for this values is #{bindings.varDeptId1.inputValue}