Populating static values in addition to database value in select one choice

Hi All,
We are using jdev 11.1.1.2.0.
I am populationg a select one choice based on a read only VO. The vo is populating fine,but in addition to the values from the database I want to add two static values. I want to add 'select customer' and 'all customer'.
Currently I am doing this using UNION in the sql query of my VO. WhenI add union in my sql query its taking more time to load the value from the database.
Is this the proper adf way to do it? Is there someother way to attain it.
Following is the query I am using to populate one of the VO's
SELECT * FROM(
SELECT ID,NAME,3 SORT_ORDER FROM CUSTOMER
UNION
SELECT -1,'SELECT CUSTOMER,1 FROM DUAL
UNION
SELECT -2,'ALL CUSTOMER,2 FROM DUAL)
ORDER BY SORT_ORDER,NAME
Please advice
Susan

Hi,
You can do this usecase by populating the values to SelectOneChoice Programmatically.
<af:selectOneChoice label="List"
binding="#{MyTestBean.myTestListComponent}">
<f:selectItems value="#{MyTestBean.listOfItems}"/>
</af:selectOneChoice>
backing bean code will be:
public List<SelectItem> getListOfItems() {
List<SelectItem> items= new ArrayList<SelectItem>();
SelectItem si = new SelectItem();
//if u trying to populate data from VO then u have set the values
DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iterBind = (DCIteratorBinding)dcBindings.get("DepartmentsView1Iterator");
for(int i=0;i<iterBind.getEstimatedRowCount();i++)
Row row = iterBind.getViewObject().getRowAtRangeIndex(i);
if(row!=null)
si = new SelectItem();
si.setLabel((String)row.getAttribute("DepartmentName"));
si.setValue(row.getAttribute("DepartmentId"));
items.add(si);
//here you can add the static values;
si = new SelectItem();
si.setLabel("Static Value1");
si.setValue("Static1");
items.add(si);
si = new SelectItem();
si.setLabel("Static Value2");
si.setValue("Static2");
items.add(si);
return items;
}

Similar Messages

  • How to get a value from  select one choice (created by static view)

    Hi,
    Whene ever Iam trying to get value from select one choice which is created by static view iam getting only index.How to get the actual value in 11g .please help me anybody .Thanx in advance....
    Edited by: 874530 on Jul 22, 2011 11:05 PM

    Thnax for your quick reply..
    Iam using 11.1.1.3.0 version.
    My code is
    <af:selectOneChoice value="#{bindings.DenialLevel.inputValue}"
    label="#{bindings.DenialLevel.label}"
    required="#{bindings.DenialLevel.hints.mandatory}"
    shortDesc="#{bindings.DenialLevel.hints.tooltip}"
    id="soc2"
    valuePassThru="true"
    binding="#{backing_denialcomment.denialLevelList}">
    <f:selectItems value="#{bindings.DenialLevel.items}" id="si6"/>
    </af:selectOneChoice>
    and in bean am not able to get value of attribute .Iam getting only index...

  • How to prevent flushing out the value in Select one choice on page refresh

    Hi All,
    I am using Jdeveloper 11.1.1.4.0. In my page fragment I am using select one choice ADF component. I have a requirement that unless one fills all details on 1st fragment he/she cant move to next fragment.
    So validations are there to check that mandatory fields filled or not. If not than I am showing message to fill the mandatory fields when user press on "Review " Button.
    But the value in select one choice is getting cleared while other input values like date fields or input text are not(The input information stored in static variables)
    How can I prevent flushing out of select one choice value .
    Thanx
    kanika

    Kanika,
    You don't have value property set due to which the selected value doesn't get stored and looses its value on refresh.
    When you drop attribute as select one choice on page, the value property get bounded to some value, did you remove it intentionally?
    If so, can you try keeping the property and see if you see the intended behavior?
    Sireesha

  • ADF Table sorting on Select One choice column display value

    Hi Team,
    We are using an ADF with EJB application.
    I have an ADF table, which has a select one choice in it. (The Select one Choice list elements are populated from a java bean).
    Presetnly, when we perform the sorting on this SOC column, the table is getting sorted based on SOC value not on the Label.
    How to sort this column based on the SOC Lable filed.
    Please help us.
    Thank you,
    Keshav Ch

    Hi Frank,
    I took a transient column in the Entity and populated this column with the LOV label value.
    In the ADF added this coulmn to the table and set it is rendered false.
    Set the sortable property of the lov column to the new trasient column.
    Now the sort will work with the label filed (Transient Column)
    Thank you,
    Keshav ch

  • Get selected value from a select one choice in the bean

    I'm trying to do with the SelectOneChoice valueChangeListener and this is the code of my method, I'm using jdeveloper11g if alguin can help as I need the value you selected in the bean
    public void cambioCombo(ValueChangeEvent valueChangeEvent) {
    CoreSelectOneChoice csoc = (CoreSelectOneChoice) valueChangeEvent.getSource();
    List childList = csoc.getChildren();
    for (int i = 0; i < childList.size(); i++) {
    if (childList.get(i) instanceof CoreSelectItem){
    CoreSelectItem csi = (CoreSelectItem) childList.get(i);
    if (((String)csi.getValue()).equals((String) valueChangeEvent.getNewValue()) ){
    System.out.println("------------>"+csi.getLabel());
    I get the following error when running the application and selecting in my select one choice
    oracle.adf.view.rich.component.rich.input.RichSelectOneChoice cannot be cast to org.apache.myfaces.trinidad.component.core.input.CoreSelectOneChoice

    This is an example of some code that i wrote.
    public void changeDesc(ValueChangeEvent valueChangeEvent) {
    // Add event code here...
    System.out.println("value "+ valueChangeEvent.getNewValue().toString());
    //System.out.println("old value "+ valueChangeEvent.getOldValue().toString());
    if (valueChangeEvent.getNewValue().toString().equals("Area Uno")){
    this.descripcion.setValue("RR.HH");
    } else {
    this.descripcion.setValue("Finanzas");
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.descripcion);
    For get the Value select in the "SelectOneChice" component i use this: valueChangeEvent.getNewValue().toString()
    cheers

  • How to set a default value in Select one choice.

    Hi
    I'm using ADF BC, in that how to set a default value in select one choice.
    pls. help on this.
    regards

    set the default value on the underlying EO or VO attribute
    john

  • How to get a value for Select One Choice in the backing bean

    Friends,
    Does any one have any idea, how to get the value of a selected item value from the Select One Choice component in the backing bean iin valueChangeListener method. Right now I am always getting the sequence of the selected item, instead the actual selected value. I tried using 'ValuePassTrhough=true' also.. but didn't help
    Below is the my code snippet
    <af:selectOneChoice value="#{bindings.country.inputValue}"
    required="#{bindings.country.hints.mandatory}"
    shortDesc="#{bindings.country.hints.tooltip}"
    id="soc1" autoSubmit="true" valuePassThru="true"
    valueChangeListener="#{pageFlowScope.Bean.onValueChange
    <f:selectItems value="#{bindings.country.items}" id="si2"/>
    </af:selectOneChoice>
    Thanks in advance.

    check my other post at Re: Pass data from a variable to another page

  • Value change listener on select one choice is not working

    Hello all,
    I have a Jsff page in that i have 2 panel group layout with panel form layout with some input fields in both.
    in first panel form layout i have select one choice drop down with 2 values in that.
    based on the selection of the list the second panel group layout will get rendered/visible(suggest me which one to use)
    but i am facing the problem when i select the value from the drop down it will navigate to the main page.
    here is my code.
    <af:selectOneChoice value="#{bindings.IsPersentAddDifferent.inputValue}"
                                    label="#{bindings.IsPersentAddDifferent.label}"
                                    required="#{bindings.IsPersentAddDifferent.hints.mandatory}"
                                    shortDesc="#{bindings.IsPersentAddDifferent.hints.tooltip}"
                                    id="soc1"
                                    valueChangeListener="#{UserManagement.isPresentAddresVCL}"
                                    autoSubmit="true">
                  <af:selectItem label="Yes" id="si1" value="Y"/>
                  <af:selectItem label="No" id="si2" value="N"/>
                </af:selectOneChoice>
    bean code:
        private RichPanelGroupLayout updateValue;
        public void isPresentAddresVCL(ValueChangeEvent valueChangeEvent) {
            valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
            System.out.println(valueChangeEvent.getNewValue().toString());
            if (valueChangeEvent.getNewValue() != null &&
                valueChangeEvent.getNewValue().toString().equalsIgnoreCase("Y"))
                updateValue.setVisible(false);
            else if (valueChangeEvent.getNewValue() != null &&
                     valueChangeEvent.getNewValue().toString().equalsIgnoreCase("N"))
                updateValue.setVisible(true);
            AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
            adfFacesContext.addPartialTarget(updateValue);
        public void setUpdateValue(RichPanelGroupLayout updateValue) {
            this.updateValue = updateValue;
        public RichPanelGroupLayout getUpdateValue() {
            return updateValue;
    and i have changed autosubmit =true for the select one choice and partialtrigger =si1 si2 for the secound panel group layout
    Thanks in advance
    Cheers

    Hi Suchith,
    You can achieve the functionality without writing a line of code. Just learn how to use page variables Creating Variables and Attribute Bindings to Store Values Temporarily in the PageDef . After,
    You just need to put a partialTrigger to your second panelGroupLayout and the visible condition like #{myVariable.inputValue eq 'Y' ? true : false}
    That should be enough for you to hide / show dynamically based on the LOV selection.
    Regards

  • Select one choice : fetch values on demand

    Hi,
    we are using Jdev 11.1.1.3.0.
    In ADF application jsff page, we have 10 LOV fields in the page, each having more than 8000 values. The page is extremly slow while loading it. When we remove all the SelectOneChoice and run the page, it is lighting fast.
    We also modified the LOVs to be "Combo Box with List of values" on the page. In this case the page load is fast, but on click of the drop down option it is taking very long to fecth data. We have also checked the "Query list Automatically" option in the UI hints.
    Can we have SelectOneChoice component and still have the values loaded only on user selects it?
    Thanks,
    Manasa.

    I would doubt that having a drop down list with that many values is useful for the customer - do you actually expect him to scroll through 8000 values to pick the one he wants?
    How about using an inputListOfValues instead? See demo here:
    http://jdevadf.oracle.com/adf-richclient-demo/components/inputListOfValues.jspx
    One more thing to check is the tuning parameters on the VO definition for the VO's that populate your LOVs - check how many records are fetched at one time, and other options there.

  • ADF web select one choice list return value

    hi
    how can i make a choice list that displays a value but return another value
    and then use it as a parameter in a method for a button
    my problem is how to return another value to the button
    thanks

    Hi,
    After creating the selectOneChoice based on the steps you followed, you will need to follow up with the steps below.
    1) Open up your Page Definition file. In the Structure panel, right click on bindings --> Insert inside bindings --> Generic bindings --> attributeValues.
    2) Under Data Source, select your iterator value used to bind the selectOneChoice component. The attribute should be your value ID (example: productId) that you want to be returned by selecting the selectOneChoice component.
    In the backing bean, you get the actual value of the selected item in the list in step #2 by resolving the expression (example) #{bindings.productId.inputValue}.
    Regards,
    Chan Kelwin

  • Populate values selects with select one choice

    How I can to create in Java??

    use a managed bean property of type ArrayList<SelectItem> and generate accessors. The reference it from f:selectItems in the selectOneChoice
    Frank

  • Different value in select one choice inside table in ADF

    Hi ADF Experts,
    jdev version 11.1.1.5
    I have an requirement like
    I have a table with 1 column as selectonechoice,
    and each selectonechoice should show different list based on department id.
    I have don't wan't backing bean approach as mention in below link (some other alternative will be helpful)
    [http://itnewscast.com/applications/how-populate-different-select-list-content-table-row|http://itnewscast.com/applications/how-populate-different-select-list-content-table-row]
    please help

    Check out Frank'S article http://www.oracle.com/technetwork/developer-tools/adf/learnmore/dec2010-otn-harvest-199274.pdf on page 27 'How-to populate different select list content per table row'
    Timo

  • "Show List of values"  showing different values than "Preview List of values for the same dimension Object

    Hi All, 
    I have a dimension object in Business Layer which is showing a different values than the original database values. When I right click on the object and select "Show List of Values its showing values which are not related to the original values in the database but if I right click on the same object and select "Preview List of Values" it shows the right values present in the database. Any suggestions on how to rectify. It was working good and many reports have been built using that particular dimension.
    Is there any way to fix the problem without the deleting the object or recreating another similar object as the object has been used in several reports, so by deleting or recreating the object may break the reports.
    Please help!

    Hi
    A  list of values is a list that contains the data values associated with an object, Lists of values inserted in the data foundation are inherited by any business layer based on the data foundation.
    Right click on the object and select  “Show Values”… Display all the DB values including null
    Preview List of Values – also display same values...getting differnece meens...Check weather using any Static List of Values.
    If you uncheck the Associated list of values check box "Preview List of Values" options is disabled.
    For best practice …LOV is disabled for un-necessary dimension objects
    Also If you have Db access check the correct data by
    SELECT
    Distinct Schema name. Table/View name. Object name
    FROM
    Schema.name. Table/View name

  • How to get selected values from Select Many Choice List

    Hello All -
    I am using Select Many Choice List and wish to get the selected values in the bean. I have created method binding for valueChangeListener for the choice list, but not sure how to get the selected values.
    I am facing problem in getting values from valueChangeEvent.getNewValue(). For Select One Choice List this returns int, but some list type object for Select Many Choice List.
    When I try to print the value it comes something like:
    ArrayList newVal = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
    System.out.println(newVal);
    [Ljava.lang.Integer;@870ad8
    Could anyone please suggest how to type cast and use the return of valueChangeEvent.getNewValue() to get the selected values.
    Regards -
    Rohit

    Hi Timo -
    Thanks for the suggestion. I could get the values as below:
    public void multiOpUnitValChange(ValueChangeEvent valueChangeEvent) {
    // Add event code here...
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding opUnitIter = (DCIteratorBinding)bindings.get("OperatingUnit2VOIterator");
    Integer[] values = (Integer[])valueChangeEvent.getNewValue();
    for (int i=0; i<values.length; i++){
    Row row = opUnitIter.getRowAtRangeIndex(i);
    System.out.println(row.getAttribute("OpUnitId"));
    Thanks -
    Rohit

  • Assigning multiple values from a List of Values at detail (table) level

    Hi,
    I have a master detail entry screen. I want to assign multiple values when end user selects an item from the list. The field is at detail level (Table type). I can do it using the "Select one choice" type component (ADF Faces Core) but it doesnt retain the value when I go to the next record. This type of component works fine with the screen with only one record to show (form type). This component has binding with list type.
    If I use simple list with Table binding, I can not assign values to multiple items. This type of list retains value when record is changed.
    Can anyone help me resolving this issue?
    Thanks,
    CAH

    Post on Jdev forum JDeveloper and OC4J 11g Technology Preview
    --Shiv                                                                                                                                                                               

Maybe you are looking for

  • Need help with an effect I am going for

    Can anyone offer advice on how to create an image where the central subject is in color while making the remaining background B&W? Thank you.

  • Get the file's path

    I am using the file upload component to choose a file. I need to save the file's path in database. The problem is that the attribute "fileName" which is blinded to this component contains the name of the file – not the file's path as I need. Could yo

  • 9iASR2 Installation Errors

    The following two elements fail with the same error on my RedHat Linux 7.3 server: Infrastructure Instance Configuration Assistant and Oracle9i Application Server randomize Password Command Config Info: binutils downgraded; links: fuser, perl, java;

  • View performance

    Hello gurus, I have a view which selects data directly from the table (which has the same structure as table) when the execution flag is 'Y'. It has around 2 million records. Is there a way to increase the performance of the view? It has index on the

  • CS3 No Longer Installs - Asks for Disc

    I have CS3 (Master Collection) installed on a Win 7 Home Premium machine.  I didn't originally install Dreamweaver and am now trying to go back and do so.  Setup runs like normal and asks me which components to add and which to reinstall.  After veri