May 27, 2012

Passing parameters to a Bounded Task flow


Follow the below procedure to pass the parameters to a task flow.

  1. Create a Task flow, flowA
  2. Add a jspx page PageA and a taskflow definition (flowB) to flowA
  3. Create a control flow case between PageA and FlowB
  4. Go to flowA’s overview tab
    1. In managebeans, create a managed bean
    2. In Parametrs, create a return value definitions to the bean value
  5. Double Click on FlowB icon in FlowA.xml and create the task flow flowB
  6. Go to flowB’s overview tab
    1. In parameters, create an input paratemeter definition
  7. Add a jspx page to flowB and create the page to display the input parameter
  8. Selecte flowB icon in flowA.xml
    1. In the properties, under parameters, add an input parameter and give the name as given to the input parameter in flowB overview, and select the value as the variable of the bean

 

May 26, 2012

Creating a table without data control


It is possible to display data of a collection object in a table format in Oracle ADF. To achieve this, create a managed bean and configure it in adfc-config.xml. Create a jsf page and create a table component as given below. Pass the collection object of managed bean as a value to the table and pass field name of the collection object which is to be displayed, as a value to the column.

<af:table value="#{<bean.collectionObject>}"
                        var="row" rowSelection="single" id="t1">
                <af:column sortProperty="c1"
                           headerText="Value"
                           id="c4">
                  <af:outputText value="#{row.<fieldname>}" id="ot4"/>
                </af:column>
</af:table>

Refreshing a component depend on other

Let us say, I have two combo boxes, one is to display list of countries and another is to display the list of states corresponding to the country selected. Which mean, whenever I select a country from the drop down, the state combo box should refresh automatically with the list of states in the selected state. To implement this in ADF, we have to do below steps.

  • The country list should submit its value whenever it is selected. To do this the below property should set to the country combo box
autoSubmit="true"
<af:selectOneChoice label=" Country" id="soc2" autoSubmit="true" />
  • A listener method needs to be written to get list of stats when country is selected and the method should be set to the country component with the below property
valueChangeListener=”#{bean.method}”
<af:selectOneChoice label=" Country" id="soc2" autoSubmit="true" valueChangeListener=”#{bean.method}”/>
  • Whenever the country is submitted the state component should refresh. To do so, the below property should set to the state component
partialTriggers="soc2"
<af:selectOneChoice label=" State" id="soc3" partialTriggers="soc2" />