Please disable your adblock and script blockers to view this page

Search this blog

Wednesday, 28 June 2017

Hide values from ADF SelectOneChoice using EL expression on UI


This post is about a specific requirement that is to hide some values from adf based select one choice from UI
Previously I have posted about disabling some items from select one choice and this post uses same steps to hide values from lov



Go through this post
Dynamically enable or disable items of ADF bound List (af:selectOneChoice) -Oracle ADF

Follow all steps and to hide values from af:selectOneChoice just write expression in rendered property of  af:selectItem instead of disabled property

<af:selectOneChoice value="#{bindings.LocationId.inputValue}" label="#{bindings.LocationId.label}"
                                        required="#{bindings.LocationId.hints.mandatory}"
                                        shortDesc="#{bindings.LocationId.hints.tooltip}" id="soc1"
                                        contentStyle="width:150px;color:red;">
                        <af:forEach items="#{bindings.Locations1.rangeSet}" var="list">
                            <af:selectItem label="#{list.City}" id="si1" value="#{list.LocationId}"
                                           rendered="#{ (bindings.DepartmentId.inputValue==100 and (list.LocationId==1000 || list.LocationId==1300)) || (bindings.DepartmentId.inputValue==110 and (list.LocationId==1500 || list.LocationId==1600 || list.LocationId==1700 || list.LocationId==1800 || list.LocationId==1900))}"/>
                        </af:forEach>
                    </af:selectOneChoice>

Now run and check application, Select Department Id 100, Only 2 Departments are visible

Now select Department Id 110, Only 5 Departments are visible

Sample ADF Application (Jdeveloper 12.1.3)- Download

Cheers :) Happy Learning

6 comments :

  1. Hi Ashish,

    We are Migrating our project from Oracle forms to ADF using Jdeveloper. For Example:-My Project has 3 modules Master(Include Customer,Item,Supplier,Salesman), Sales & Purchase modules. It contains more than 50 forms.
    Can you just give us explanation on how you split them and integerate as single project.

    ReplyDelete
    Replies
    1. Suppose you have multiple forms that you want to integrate as one project, In this case you can deploy independent application as Jar and create a main application and attach application JARs as library and in a dynamic region you can call any application using Bounded taskFlows

      I think this is the best way to integrate multiple projects in one

      Ashish

      Delete
    2. Thanks Ashish for the info.
      Whether you are mentioning Cylinder Architecture or Sum of Parts architecture or other architecture pattern?

      Delete
  2. hi NET-RAJ .. thanks for your question its really one of the main problem to think about
    " How to organize the big project "
    i hope Ashish give us good explanation on this topic .... Thanks

    ReplyDelete
  3. I have a question: If I have a region, then country , then department, and then employee, all connected one by one through foreign keys how do I make the connection between let's say region and employee or country and employee? I have cascaded them region->country->department->employee but when I choose a region nothing shows in employees

    ReplyDelete
    Replies
    1. If relation is like this then you must select Department to see employess of that , Or another way is to make a view that has region wise employees and then create a link between region and region wise employees view

      Ashish

      Delete