Pages

Monday, January 27, 2014

List of Value using Tree and ForEach

List of Value using Tree and ForEach

 Using  Tree and ForEach

we will use Departments Table ( Id , Name, Location ... )


we need to add a tree in Binding for the Page.


Click Ok then  you will see this popup , Click add then choose the ViewObject that you want to use
in our case wee need DepartmentsView .




Then add the rule as below

then choose the Attributes that you want , in our case we need DepartmentId and DepartmentName

Then click Ok .
now you can see Tree in the Bindings and its name DepartmentsView1

Now You can use the Tree in For Each

and here is the Code for ForEach
________________________________________________________

<af:selectOneChoice label="Department" autoSubmit="true"
        valueChangeListener="#{LovMB.lovTreeChangeListner}">
     <af:forEach items="#{bindings.DepartmentsView1.rangeSet}"          var="row">

        <f:selectItem itemLabel="#{row.DepartmentName}" itemValue="#{row.DepartmentId}"/>

     </af:forEach>
 </af:selectOneChoice>
________________________________________________________


and this the code for ValueChangeListner



The final result will be


No comments:

Post a Comment