Changing dropdown list selected value in JSP

I would like a dropdown list to load with all values in a database table, which is no problem. But, I would then like it to display a selected text value from that list, depending on the value returned by a SQL query. As an example, say I was looking-up someone's personal data and there was a dropdown list that listed all the possible hair colors. If this person had been entered as having blonde hair, I want the dropdown list to display blonde at page load, but give the user the option to select another color if a change is needed.
Thanks in advance for ur help.

<option value="<c:out value="${currentchoice}"/>"
    <c:if test="${currentchoice=='db_value'}">     
        SELECTED 
    </c:if>
>

Similar Messages

  • Open tabbed panels from dropdown list option value

    I have about 10 tabbed panels on my page.
    I created a dropdown list, <option value></option value>.
    I need to open the specific panel when an option is selected from the dropdown list.  I know how to open tabbed panels by URL, a button, and a link on the same page.  But how do i open a tabbed panel from a dropdown list.  The <option value> in IE does not allow for onclick events in IE. 

    Yes and I have been trying to find that.  Right now I have it setup where the onchange event is "location = this.options[this.selectedIndex].value;">
    and then I have each<option> in the dropdown list with teh value=http://URL.com?tab=3#tabbedpanels1.
    It works but it isn't as dynamic as I would like.  When i select each option in the dropdown, it refreshes the page and opens the correct tabbed panel. Then the dropdown list is reset to the default value because the page refreshed.  I wanted to do this without the page refreshing, that way the dropdown list item remains at what I selected to open the tabbedpanel. and plus, I didn't want the page to refresh everytime but to just open the tabbedpanel the same way as if i made a button to open it.

  • Dropdown value list selected value not being displayed

    HCM process and form  - Using HR Admin control library in Adobe form to create a new drop down list  as per OSS Note Note 973170 - New library for "SAP Interactive Forms by Adobe" - HR Admin Drop Down box list.
    User is able to choose values from dropdown list. But, when form is sent for approval, approving user is not seeing selected value.
    Thanks,
    Karu

    Hi karu,
    Follow the below steps,
    1. Place the dropdown list box in the form
    2.bind the attributes to the dropdown.
    3.In Object tab Property  Click List Item, One Pop up Window is displayed,
       In the popup window,
                           i.  Bind the dropdown list attributes to the  items.
                           ii. $ symbol assigned to the Item text
                           iii.$ symbol assigned to the item value.
    by
    Parthasarathi

  • Select list: Display the selected value using JSP

    Hi
    I have a select list with a set of values and when I select a value from the list I want the selected text to appear on the screeen. How do I display the selected value?
    Please help:
    Here is the code for the list:
    <select name="arraySelect" size="8" onclick="">
    <%for (int i = 0; i < dumpArray.length; i++) {
    if( i == 3){
    %>
    <option value="<%=dumpArray%>" selected><%=dumpArray[i]%></option>
    <% i++;} else %>
    <option value="<%=i%>"><%=dumpArray[i]%></option><p>
    <% } %>
    </select>
    <% String name;
    name = request.getParameter("arraySelect");
    out.println(name);
    I tried request parameter but it did not help. How can I do it?

    did you submit your page?

  • Data Table will not bind to Dropdown List selection

    I get the following error when I try to use my own database tables (As in the "Using Databound Components to Access Databases" tutorial). It is a Oracle9i database. The Table (Vehicle)I use to populate the Dropdown List has around 450 000 rows, and the ComponentRowset returns 362 000 rows when run without a parameter.
    Exception Details: javax.faces.el.EvaluationException
    java.lang.NullPointerException
    Possible Source of Error:
    Class Name: com.sun.faces.el.ValueBindingImpl
    File Name: ValueBindingImpl.java
    Method Name: getValue
    Line Number: 206
    Please help! What am I doing wrong? As far as I can see the code is identical to the "Using Databound Components to Access Databases" tutorial.
    Here is the code:
    * Page1.java
    * Created on 12 October 2004, 05:56
    * Copyright jgenis
    package ucodapp;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.data.*;
    import javax.faces.component.*;
    import com.sun.sql.rowset.*;
    import javax.faces.event.*;
    import javax.faces.convert.*;
    public class Page1 extends AbstractPageBean {
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
        private int __placeholder;
        private HtmlForm form1 = new HtmlForm();
        public HtmlForm getForm1() {
            return form1;
        public void setForm1(HtmlForm hf) {
            this.form1 = hf;
        private HtmlDataTable dataTable1 = new HtmlDataTable();
        public HtmlDataTable getDataTable1() {
            return dataTable1;
        public void setDataTable1(HtmlDataTable hdt) {
            this.dataTable1 = hdt;
        private JdbcRowSetXImpl componentRowSet = new JdbcRowSetXImpl();
        public JdbcRowSetXImpl getComponentRowSet() {
            return componentRowSet;
        public void setComponentRowSet(JdbcRowSetXImpl jrsxi) {
            this.componentRowSet = jrsxi;
        private HtmlOutputLabel componentLabel1 = new HtmlOutputLabel();
        public HtmlOutputLabel getComponentLabel1() {
            return componentLabel1;
        public void setComponentLabel1(HtmlOutputLabel hol) {
            this.componentLabel1 = hol;
        private HtmlOutputText componentLabel1Text = new HtmlOutputText();
        public HtmlOutputText getComponentLabel1Text() {
            return componentLabel1Text;
        public void setComponentLabel1Text(HtmlOutputText hot) {
            this.componentLabel1Text = hot;
        private UIColumn column1 = new UIColumn();
        public UIColumn getColumn1() {
            return column1;
        public void setColumn1(UIColumn uic) {
            this.column1 = uic;
        private HtmlOutputText outputText1 = new HtmlOutputText();
        public HtmlOutputText getOutputText1() {
            return outputText1;
        public void setOutputText1(HtmlOutputText hot) {
            this.outputText1 = hot;
        private HtmlOutputText outputText2 = new HtmlOutputText();
        public HtmlOutputText getOutputText2() {
            return outputText2;
        public void setOutputText2(HtmlOutputText hot) {
            this.outputText2 = hot;
        private UIColumn column2 = new UIColumn();
        public UIColumn getColumn2() {
            return column2;
        public void setColumn2(UIColumn uic) {
            this.column2 = uic;
        private HtmlOutputText outputText3 = new HtmlOutputText();
        public HtmlOutputText getOutputText3() {
            return outputText3;
        public void setOutputText3(HtmlOutputText hot) {
            this.outputText3 = hot;
        private HtmlOutputText outputText4 = new HtmlOutputText();
        public HtmlOutputText getOutputText4() {
            return outputText4;
        public void setOutputText4(HtmlOutputText hot) {
            this.outputText4 = hot;
        private UIColumn column3 = new UIColumn();
        public UIColumn getColumn3() {
            return column3;
        public void setColumn3(UIColumn uic) {
            this.column3 = uic;
        private HtmlOutputText outputText5 = new HtmlOutputText();
        public HtmlOutputText getOutputText5() {
            return outputText5;
        public void setOutputText5(HtmlOutputText hot) {
            this.outputText5 = hot;
        private HtmlOutputText outputText6 = new HtmlOutputText();
        public HtmlOutputText getOutputText6() {
            return outputText6;
        public void setOutputText6(HtmlOutputText hot) {
            this.outputText6 = hot;
        private UIColumn column4 = new UIColumn();
        public UIColumn getColumn4() {
            return column4;
        public void setColumn4(UIColumn uic) {
            this.column4 = uic;
        private HtmlOutputText outputText7 = new HtmlOutputText();
        public HtmlOutputText getOutputText7() {
            return outputText7;
        public void setOutputText7(HtmlOutputText hot) {
            this.outputText7 = hot;
        private HtmlOutputText outputText8 = new HtmlOutputText();
        public HtmlOutputText getOutputText8() {
            return outputText8;
        public void setOutputText8(HtmlOutputText hot) {
            this.outputText8 = hot;
        private UIColumn column5 = new UIColumn();
        public UIColumn getColumn5() {
            return column5;
        public void setColumn5(UIColumn uic) {
            this.column5 = uic;
        private HtmlOutputText outputText9 = new HtmlOutputText();
        public HtmlOutputText getOutputText9() {
            return outputText9;
        public void setOutputText9(HtmlOutputText hot) {
            this.outputText9 = hot;
        private HtmlOutputText outputText10 = new HtmlOutputText();
        public HtmlOutputText getOutputText10() {
            return outputText10;
        public void setOutputText10(HtmlOutputText hot) {
            this.outputText10 = hot;
        private UIColumn column6 = new UIColumn();
        public UIColumn getColumn6() {
            return column6;
        public void setColumn6(UIColumn uic) {
            this.column6 = uic;
        private HtmlOutputText outputText11 = new HtmlOutputText();
        public HtmlOutputText getOutputText11() {
            return outputText11;
        public void setOutputText11(HtmlOutputText hot) {
            this.outputText11 = hot;
        private HtmlOutputText outputText12 = new HtmlOutputText();
        public HtmlOutputText getOutputText12() {
            return outputText12;
        public void setOutputText12(HtmlOutputText hot) {
            this.outputText12 = hot;
        private UIColumn column7 = new UIColumn();
        public UIColumn getColumn7() {
            return column7;
        public void setColumn7(UIColumn uic) {
            this.column7 = uic;
        private HtmlOutputText outputText13 = new HtmlOutputText();
        public HtmlOutputText getOutputText13() {
            return outputText13;
        public void setOutputText13(HtmlOutputText hot) {
            this.outputText13 = hot;
        private HtmlOutputText outputText14 = new HtmlOutputText();
        public HtmlOutputText getOutputText14() {
            return outputText14;
        public void setOutputText14(HtmlOutputText hot) {
            this.outputText14 = hot;
        private RowSetDataModel dataTable1Model = new RowSetDataModel();
        public RowSetDataModel getDataTable1Model() {
            return dataTable1Model;
        public void setDataTable1Model(RowSetDataModel rsdm) {
            this.dataTable1Model = rsdm;
        private HtmlSelectOneMenu dropdown1 = new HtmlSelectOneMenu();
        public HtmlSelectOneMenu getDropdown1() {
            return dropdown1;
        public void setDropdown1(HtmlSelectOneMenu hsom) {
            this.dropdown1 = hsom;
        private UISelectItems dropdown1SelectItems = new UISelectItems();
        public UISelectItems getDropdown1SelectItems() {
            return dropdown1SelectItems;
        public void setDropdown1SelectItems(UISelectItems uisi) {
            this.dropdown1SelectItems = uisi;
        private JdbcRowSetXImpl vehicleRowSet = new JdbcRowSetXImpl();
        public JdbcRowSetXImpl getVehicleRowSet() {
            return vehicleRowSet;
        public void setVehicleRowSet(JdbcRowSetXImpl jrsxi) {
            this.vehicleRowSet = jrsxi;
        private BigDecimalConverter dropdown1Converter = new BigDecimalConverter();
        public BigDecimalConverter getDropdown1Converter() {
            return dropdown1Converter;
        public void setDropdown1Converter(BigDecimalConverter bdc) {
            this.dropdown1Converter = bdc;
        // </editor-fold>
        public Page1() {
            // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
            try {
                componentRowSet.setDataSourceName("java:comp/env/jdbc/CDS");
                componentRowSet.setCommand("SELECT ALL TRACKER.COMPONENT.PINNO, TRACKER.COMPONENT.UNITCODE, TRACKER.COMPONENT.INSTALLEDDATE, TRACKER.COMPONENT.INSTALLREPORTNO, TRACKER.COMPONENT.TNUSERIALNO, TRACKER.VEHICLE.REGNO, TRACKER.VEHICLE.VINNO, TRACKER.VEHICLE.VEHICLEID, TRACKER.TRACKERAGREEMENT.TAID, TRACKER.TAPRODUCT.TAPRODUCTID, TRACKER.COMPONENT.COMPONENTID, TRACKER.COMPONENT.TAPRODUCTID, TRACKER.COMPONENT.COMPONENTTYPEID, TRACKER.COMPONENT.INSTALLERID, TRACKER.TAPRODUCT.TAID, TRACKER.TAPRODUCT.PRODUCTTYPEID, TRACKER.TAPRODUCT.TAPRODUCTSTATUSID, TRACKER.TAPRODUCT.PRORATANRDAYS, TRACKER.TAPRODUCT.CONTRACTPERIOD, TRACKER.TAPRODUCT.BILLINGFREQUENCYID, TRACKER.TAPRODUCT.CANCELLATIONDATE, TRACKER.TAPRODUCT.STARTDATE, TRACKER.TAPRODUCT.SOURCEID, TRACKER.TAPRODUCT.PRICINGDATE, TRACKER.TAPRODUCT.DEALTYPEID, TRACKER.TAPRODUCT.ACTIONTYPEID, TRACKER.TAPRODUCT.ISSTANDARDBATTERY, TRACKER.TAPRODUCT.AUDITUSERID, TRACKER.TAPRODUCT.AUDITSRID, TRACKER.COMPONENT.SERIALNUMBER, TRACKER.COMPONENT.RECEIVEDDATE, TRACKER.COMPONENT.RESPONSECODE, TRACKER.COMPONENT.REPLYCODE, TRACKER.COMPONENT.ACTIVATIONCODE, TRACKER.COMPONENT.ALERT, TRACKER.COMPONENT.ALTDEACTIVATIONCODE, TRACKER.COMPONENT.INSTALLEDLOCATION, TRACKER.COMPONENT.VERSION, TRACKER.COMPONENT.SOFTWAREVERSION, TRACKER.COMPONENT.CANACTIVATE, TRACKER.COMPONENT.COMPONENTSTATUSID, TRACKER.COMPONENT.SIMNO, TRACKER.COMPONENT.LOCATECELLNO, TRACKER.COMPONENT.AUDITDT, TRACKER.COMPONENT.THEFTNO, TRACKER.TAPRODUCT.STATUSBEFORECANCELLATION, TRACKER.TAPRODUCT.AUDITDT, TRACKER.TRACKERAGREEMENT.VEHICLEID, TRACKER.TRACKERAGREEMENT.CUSTOMERID, TRACKER.TRACKERAGREEMENT.TASTATUSDATE, TRACKER.TRACKERAGREEMENT.TASTATUSID, TRACKER.TRACKERAGREEMENT.AUDITUSERID, TRACKER.TRACKERAGREEMENT.AUDITSRID, TRACKER.TRACKERAGREEMENT.AUDITDT, TRACKER.VEHICLE.MAKEMODELID, TRACKER.VEHICLE.VEHICLECOLOURID, TRACKER.VEHICLE.COLOURSHADEID, TRACKER.VEHICLE.BATTERYID, TRACKER.VEHICLE.INSURERID, TRACKER.VEHICLE.ENGINENO, TRACKER.VEHICLE.CHASSISNO, TRACKER.VEHICLE.POLICYNO, TRACKER.VEHICLE.YEARMODEL, TRACKER.VEHICLE.JOINDATE, TRACKER.VEHICLE.POLICYCOMMENCEDATE, TRACKER.VEHICLE.DESCRIPTION, TRACKER.VEHICLE.ACTIVE, TRACKER.VEHICLE.METALLICIND, TRACKER.VEHICLE.TEMPREGNO, TRACKER.VEHICLE.ORDERNUMBER, TRACKER.VEHICLE.POLICYSEQUENCENO, TRACKER.VEHICLE.AUDITUSERID, TRACKER.VEHICLE.AUDITSRID, TRACKER.VEHICLE.AUDITDT, TRACKER.VEHICLE.THEFTNO  FROM TRACKER.COMPONENT INNER JOIN TRACKER.TAPRODUCT ON TRACKER.COMPONENT.TAPRODUCTID=TRACKER.TAPRODUCT.TAPRODUCTID INNER JOIN TRACKER.TRACKERAGREEMENT ON TRACKER.TAPRODUCT.TAID=TRACKER.TRACKERAGREEMENT.TAID INNER JOIN TRACKER.VEHICLE ON TRACKER.TRACKERAGREEMENT.VEHICLEID=TRACKER.VEHICLE.VEHICLEID WHERE TRACKER.VEHICLE.VEHICLEID=?");
                dataTable1Model.setDataCacheKey("com.sun.datacache.Page1.componentRowSet");
                dataTable1Model.setRowSet(componentRowSet);
                dataTable1Model.setSchemaName("");
                dataTable1Model.setTableName("");
                vehicleRowSet.setDataSourceName("java:comp/env/jdbc/CDS");
                vehicleRowSet.setCommand("SELECT ALL TRACKER.VEHICLE.VEHICLEID, TRACKER.VEHICLE.REGNO  FROM TRACKER.VEHICLE");
                vehicleRowSet.setFetchSize(1000);
            } catch (Exception e) {
                log("Page1 Initialization Failure", e);
                throw e instanceof javax.faces.FacesException ? (FacesException) e : new FacesException(e);
            // </editor-fold>
            // Additional user provided initialization code
            // Initialization Code
            // Part of the Using Databound Components to Access Databases Tutorial
            // You can find this tutorial on the web -- use the link on the Welcome page
            try {
                vehicleRowSet.execute();
                vehicleRowSet.next();
                dataTable1Model.setObject(1, vehicleRowSet.getObject("VEHICLEID"));
            } catch (Exception ex) {
                throw new FacesException(ex);
            } // end try catch
        protected ucodapp.ApplicationBean1 getApplicationBean1() {
            return (ucodapp.ApplicationBean1)getBean("ApplicationBean1");
        protected ucodapp.SessionBean1 getSessionBean1() {
            return (ucodapp.SessionBean1)getBean("SessionBean1");
         * Bean cleanup.
        protected void afterRenderResponse() {
            vehicleRowSet.close();
            vehicleRowSet.close();
            componentRowSet.close();
        public void dropdown1_processValueChange(ValueChangeEvent vce) {
            // Dropdown List Event Code
            // Part of the Using Databound Components to Access Databases Tutorial
            // You can find this tutorial on the web -- use the link on the Welcome page
            try {
                dataTable1Model.setObject(1, dropdown1.getValue());
                dataTable1Model.execute();
            } catch (Exception e) {
                log("vehicle id change exception", e);
                error("Exception changing Vehicle Id: " + e);
            } // end try catch
            // User event code here...

    Take a look at the Page1 constructor.
    It appears that you're trying to bind the datatable to 2
    different rowsets. I suggest to clean up this
    constructor to make sure you're using the right
    rowset.
    Your value binding expressions on each column
    of the datatable may not be set to the right column.
    John
    JSC QA

  • Auto Submit when changing Dropdown list

    I have a Dropdown list which reloads the page with other values after a change.
    How can i achieve that the option i selected in the dropdown list is preselected again after the reload of the page?
    Thanks

    I have a Dropdown list which reloads the page with other values after a change.
    How can i achieve that the option i selected in the dropdown list is preselected again after the reload of the page?
    Thanks

  • Immediate Submit From Dropdown List Selection

    In JSF what is the best way to get the form to submit immediately when a dropdown list item is selected? I know I can use a JavaScript onchange="..." but just wondering if there is a more standard/cool way of doing this in JSF.
    Thanks!
    Vaughn

    No. Simply creating a ValueChangeListener won't do what he wants. When he used the term "immediately" he meant "as soon as the value changes" and not "immediate" in the sense of bypassing Faces lifecycles. This can be seen from his reference to "onchange=".
    The suggestion I am about to make solves one problem but creates another.
    In addition to valueChangeListener= "#{...}" and immediate="true", put onchange="submit()". This will execute your event as soon as the value changes BUT...
    Faces navigation doesn't work any more when you return a navigation target.
    How do we get Faces Navigation to keep working when we use "onchange" ?

  • Use Select Value in JSp on same Page

    Sir,
    In my Jsp page there is one dropdown,sir i want to get that select value in same page so that i can display data on same page below the dropdown based on the <select> value.
    Is it possible to do this things.
    Plz reply Soon.
    Thanks,
    Regards,
    Ashish

    I ideally start by reducing the 2-page functionality - of form page and action page - to just one. It goes like this:
    <cfset isValidationPassed = false>
    <cfif isDefined("form.someVar")>
    <!--- Do validation. Validated form implies isValidationPassed is true --->
    </cfif>
    <cfif isValidationPassed>
    <!--- Do action page stuff --->
    <cfelseif NOT isDefined("form.someVar") OR NOT isValidationPassed>
    <!--- Display the form. --->
    <!--- If form had been submitted, inform user which validation failed, and what to correct. Display the form. --->
    <cfoutput><form method="post" action="#CGI.SCRIPT_NAME#"></cfoutput>
    </form>
    </cfif>
    The idea is then to pile on the complexity, layer by layer.

  • List of values in jsp and servlet

    I have one jsp page listing some details of a product and list of some values as shown below:
    productId :::: name ::::: description ::::: (here is list of values)
    productId :::: name ::::: description ::::: (here is list of values)
    productId :::: name ::::: description ::::: (here is list of values)
    productId :::: name ::::: description ::::: (here is list of values)
    productId :::: name ::::: description ::::: (here is list of values)
    productId :::: name ::::: description ::::: (here is list of values)
    (then a submit button)
    hitting on submit button should send to all productId and corresponding selected values from lov to a servlet. How can this be achieved????
    Any ideas???

    You haven't provided adequate relevant details.
    Can you show some sample code of what exactly you're looking for?
    Are you using some kind of an html input form that allows one to enter the list of values per product?
    If this is the case then , if you are using an HTML form with form fields, you would specify the /servletURL (as defined in your project's web.xml) , in the form's action attribute. Then in the Servlet you would use HTTP Request object , to get the values from the form - most likely in a for loop.
    Or is the list of products already populated by previous code?
    If it is then, store that object in the JSP page's request object and then,
    read the request object in the servlet.

  • How do I display Text linked to a dropdown list selection in a form?

    Ok, I have a form that has a dropdown list with several selections. What I want to have happen is when someone selects one of the options from the dropdown, I want to have text displayed to the right of that information that pertains to that selection.
    I have attached the page with the form I have created as well as the css document that is used.
    Any insight would be most appriciated! Thanks in advance!

    Hi,
    I browsed for you a bit and found this: http://javascript.internet.com/forms/suggest-messages.html Looks like what you need!
    Otherwise just search this database: http://javascript.internet.com/forms/

  • Dropdown list default value  in Visual Composer

    Hi all  ,
    i have dropdown list in my Visual composer layout  i have values coming like 2001 to 2014 ,everything is fine . i need to display default value in the dropdown list should be curent year like 2009when i deploy the application by default the current year should be displayed in input field.

    Hi Venkatp,   
    To Assign the function into the dropdown inputfield DSTR(NOW(),'YYYY') and you can to display the current year
    Followings links are available to display the dateformat,
    http://www.sdn.sap.com.ngrs.net/irj/scn/index?rid=/library/uuid/60535002-571c-2c10-58b6-cc27faa7be4d&overridelayout=true
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/7556c6b7-0e01-0010-878b-cbf4dbe859eb&overridelayout=true
    Regards,
    Prabha

  • Dynamic Drop-down list - selected value can't be cleared ...

    1. check out the following code of a dynamic drop down list using cursor :-
    DECLARE
         -- DROP-DOWN LIST OF ALL DEPARTMENTS
         TEMPNUMBER NUMBER(2) := 2 ;
    -- Because we've to initialize the list
    -- at least with 1 item.
    CURSOR C_DEPT IS
         SELECT DEPT_ID FROM DEPARTMENT;
    BEGIN
         ABORT_QUERY ;
         CLEAR_LIST('DEPTLIST');
         FOR TEMP IN C_DEPT LOOP
         ADD_LIST_ELEMENT( 'DEPTLIST', TEMPNUMBER, TEMP.DEPT_ID, TEMP.DEPT_ID );
         :SRBLOCK.LST := TEMP.DEPTNO;
         -- prev. line set the newly selected value
         TEMPNUMBER := TEMPNUMBER + 1 ;
         END LOOP;     
    END;
    2. problem is as we've to atleast initialize with one list item... that item can't be cleared with CLEAR_LIST.
    3. how can i actually clear that and still use cursor. because i've searched forum for this thing and found all those code not working ... for my project ...
    4. quick help needed ...

    Hi Omar,
    I have solution for you
    To populating or refreshing the lists you can use
    two procedures:
    One of them - generic, which can be used for all types of list
    Another is specific which contain a SQL statement to retrieve the data for
    particular list.
    1. Specific procedure:
    PROCEDURE GET_DEPARTMENT_LIST
    IS
    sql_stat VARCHAR2(32767);
    ret_code NUMBER;
    BEGIN
    -- SQL Statement for Drop-down List
    -- (must have two columns for label and value - both VARCHAR2)
    sql_stat := ' SELECT DEPARTMENT_NAME,TO_CHAR(DEPT_ID)'
    ||' FROM SCHEMA.DEPARTMENT';
    POPULATE_MY_LIST('BLOCK.DEPARTMENT_LIST',sql_stat,ret_code);
    END;
    2. Generic procedure:
    PROCEDURE POPULATE_MY_LIST
    (item_name VARCHAR2,
    sql_stat VARCHAR2,
    out_code OUT NUMBER)
    IS
    rg_id RECORDGROUP;
    rg_name VARCHAR2(100);
    ret_code NUMBER;
    item_id ITEM;
    BEGIN
         item_id := FIND_ITEM(item_name);
         IF ID_NULL(item_id) THEN
              out_code := -1;
              RETURN;
         END IF;
         --Creating Record Group with Unique Name
         rg_name := 'RG_'||SUBSTR(item_name,INSTR(item_name,'.',1)+1,LENGTH(item_name));
         --Checking Record Group Name for existance
         rg_id := FIND_GROUP(rg_name);
         --If Group does exist - delete it
         IF NOT ID_NULL(rg_id) THEN
              DELETE_GROUP(rg_id);
         END IF;
         --Creating Record Group
         rg_id := CREATE_GROUP_FROM_QUERY(rg_name,sql_stat);
    ret_code := POPULATE_GROUP(rg_id);
    IF (ret_code <> 0) THEN
         out_code := ret_code;
         RETURN;
    END IF;
    POPULATE_LIST(item_name,rg_id);
    IF NOT FORM_SUCCESS THEN
         out_code := -2;
         RETURN;
    ELSE
    out_code := 0;     
    END IF;
    DELETE_GROUP(rg_id);
    END;
    Hope it help.
    Dmitry

  • How can i change the list of values for the items of type displaying in a ACC in ID format to Name format?

    I have 2 tables venue and concert. i have imported dummy values from xml file and data is imported to db successfully. when i go to ACC, afer select my EventsRepository->concert->click list. showing results in ID formatEventRepository:Concert:70701.
    Can anyone tel me how to show my results by name?

    You need to set the display-property="<<Your name property>>" in item-descriptor tag.
    e.g. <item-descriptor name="myItem" display-property="name" />
    Cheers
    R

  • May I show multiselect pick list selected values in a report

    People
    Im new at Oracle Ondemand but already worked quite a lot with it.
    One thing I can't find out is how to show selected multi select pick list values in a report.
    Cant pick that values with formula edito either....
    I fell that It must be easy and I am not knowing where to watch...
    Thanks in advance for your help.

    Thanks Alex!!!
    I understand that if I need reporting of this kind of fields best idea is NOT using them....
    Is there a work around?
    Regards

  • Calculate DropDown List items values

    I have 7 DDLists for the availability of the employees for 7 days the week.
    DD1, DD2, DD3, DD4, DD5, DD6, DD7
    The list items for all are the same:
    Day, Evening, Night, N/A(Not Available)
    How I can calculate  in a field  the Total Days of Availability
    and in a separate field Total Days N/A?
    Thank you

    Hi,
    A few things to correct
    1) You must use square brackets -- My Fault -- not sure how that one got past me!
              DDLday[i]
    2) DDLs can't have values the same for the items meaning change them to:
         0 = N/A, 1= Day, 2= Eve, 3= Nite
    3) You only need the 1 script --don't place script on the NumNA field--delete that whole script
    4) At the end of the script, you must reference the N/A Field correctly. You're not using the name you gave it--you're using the name I gave it so it can't find it.
         NumNA = notAvailable  //Either rename the NA field to NumNA  or change the script but putting the field name you're using
    5) Finally, I don't remember coming accross this before, but the script needs to have the last 2 lines switched. It seems to matter.
    var available = 0
    var notAvailable = 0
    for i = 0 upto 6 do
         if(DDLday[i] > "0")then    //square brackets
              available = available + 1
              continue
         else
              notAvailable = notAvailable + 1
              continue
         endif
    endfor
    NumNA = notAvailable     //NumNA is the other field
    $ = available                       // this must be the last line
    So, 2 of the problems were my fault.
    That should do it.
    Stephen

Maybe you are looking for

  • My Macbook pro suddenly running very slow

    I have a 13" mid 2012 Macbook pro running OS X Mavericks v 10.9.4. About two weeks ago it suddenly became very slow and unresponsive. Startup and shut down takes much longer than usual, file transfers are slow and apps are taking forever to launch. T

  • How to add a java dialog instance to Java central instance of SAP CRM

    Hi Gys, I have installed a new dialog instance for the CRM Java landscape for the version 7.01 . CRM Abap instance is seperate and its data accessed by Jco connection by central instance but not dialog instance . Could you please let me know if any c

  • How can I transfer android photos to iPhoto?

    How can I sync Samsung Fascinate/Galaxy S photos with iPhoto on my iMac? Thanks

  • Why VPLS and not L3 VPNs ???

    Hi all Please bare with me, i know a lot has been written about what VPLS is, I have read the postings, but maybe someone can in simple terms answer my qn for me; Why should one go for VPLS and not L3 VPNs or L3 VPNs and not VPLS, i need arguments fr

  • Can i add a field to exestion ods or cube

    HI gurus, can any body help regarding following doubt.... Can i add a characteristics or key figure  to a cube or ODS which all ready contain data if yes how to add a info object to the cube and how to add a info object to the ODS. in 3.X Thanks.....