Default value dynamic select list

Hi everybody,
I have a question concerning dynamic select lists.
I have a report of a table that shows some records. Each record has different versions of data. So when you click on a record you get to another page where you get some information about this record and where you can select the version of this information (with the help of a select list).
The select list works fine and is defined dynamically as follows:
select distinct a.name display_value,
a.version_id return_value
from cn_pl_version a,
cn_pl_std_peplanung b
WHERE a.version_ID = b.version_id AND
b.pe_id = '&P6_HELP_PRODET.'
order by a.version_id desc
My problem is that when I click on a record I always get the report filled with the oldest version of the current record, so I always have to choose the newest version in the select list manually. I would prefer always to have the newest version in the report.
The query for the report is as follows:
select
(select sum(stunden) from cn_pl_std_peplanung t02
where abt_id = '10'
and t02.pe_id = t1.pe_id
and t02.version_id = t1.version_id
and t02.idee_id = t1.idee_id) stunden_ir,
(select name from cn_pl_version u01
where u01.version_id = t1.version_id) Version
from cn_pl_std_peplanung t1, cn_pl_projektelemente z1, cn_pl_version u1, cn_pl_projektidee s1
where t1.version_id = '&P6_VERSION_WAHL.'
and t1.pe_id = z1.pe_id
and z1.pe_id='&P6_HELP_PRODET.'
group by t1.pe_id, t1.version_id, t1.idee_id
'&P6_VERSION_WAHL.' is the item of the select list
'&P6_HELP_PRODET.' is the ID of the current record
I'm not sure if you understood my problem, my english isn't the best...
Thanks for any kind of help!!
Patrick

Hi Patrick,
what value does you select list show, when you branch to the page? Is it the correct one?
If not you should change your select list, that the correct version is selected as default. You can define a "default value" when you set the source of the element.
Otherwise you can maybe set up an example application at http://apex.oracle.com.
Best Regards
chrissy

Similar Messages

  • Possible bug ? - Default value for select list

    4.2.1
    Hi, I have one page with a couple of reports. I have a time period filter on top. Its a select list with values 7 days, 3 months and 12 months. Default value is set to 3 (where return values of select list is 1,2,3 resp).
    Now in page 1 which has this select list, :P1_SELECT it has a report which shows counts of number of items purchased. When the user clicks on the count(hyperlinked column), it takes the user to another page which runs the details of the items and also uses the Page 1 select. It works fine when I change the time period. However, if I dont change the time period in the select list when I first login, althought I have set the default value to 3, the interactive report on page shows no data found, because the select list default value I guess it does not recognize.
    Is this a bug?
    Thanks,
    Sunil

    ryansun wrote:
    4.2.1
    Hi, I have one page with a couple of reports. I have a time period filter on top. Its a select list with values 7 days, 3 months and 12 months. Default value is set to 3 (where return values of select list is 1,2,3 resp).
    Now in page 1 which has this select list, :P1_SELECT it has a report which shows counts of number of items purchased. When the user clicks on the count(hyperlinked column), it takes the user to another page which runs the details of the items and also uses the Page 1 select. It works fine when I change the time period. However, if I dont change the time period in the select list when I first login, althought I have set the default value to 3, the interactive report on page shows no data found, because the select list default value I guess it does not recognize.
    Is this a bug?NO.
    Default values is only populated on the clien side and NOT in the session.
    This has been discussed thousands of times in the forum..found this with a simple search {message:id=4440597}

  • Define default value for Select List

    Hello,
    I have an Item on the page, which is a Select list
    And I have a LOV associated with this item, which is a database query.
    How do I make one of the values of this LOV to be a default value of this Select list?
    I need this value to be displayed first, instead of a Null value.
    Thanks!

    That's right - use the Default value area of your Item definition.
    Have a look at this post:
    Re: previous selected option as default value
    May be you will find it useful...

  • How to show first parameter value in drop down list as a default value dynamically in ssrs report?

    Hi,
    in my ssrs report i have two parameters, accounts and Manager ,there is a cascading between the accounts parameter and manager parameter, as per the cascading we will get managers names based on the account we selected in the accounts parameter,
    my requirement is the first name in the mangers drop down list  has to get selected as default value.
    please help me with this, it is an urgent requirement.
    Thanks in advance,
    Naveen

    Hi NaveenMSBI,
    According to your description, you want to use cascading parameters in the report, if the accounts are selected when you preview the report, the first manager name will be selected from drop down list as the default value. If so, there can be two scenarios:
    • If manager is single-valued parameter, we can get Available Values and Default Values from the same query as below. Then when the accounts are selected, the first manager name will be selected as default value.
    SELECT managerName FROM table_name WHERE accounts IN (@accounts)
    • If manager is multi-valued parameter, we need to use different query for Available Values and Default Values. In this case, please refer to Patrick’s solution.
    For more information about Adding Cascading Parameters, please refer to the following document:
    http://technet.microsoft.com/en-us/library/aa337498(v=sql.105).aspx
    If you have any questions, please feel free to let me know.
    Best Regards,
    Wendy Fu

  • How to assign list of default value for select-option variable???

    Hi every one
    This is Deepak,
    I want to know how to assign list of default value to select-option variable ? please any body tel me solution
    for example
    select-option matnr for mara-matnr default ..............and here i want to give more than 1 values that will be default value and use can choose any one at the time of input .
    Thank you in advance
    Deepak

    Hi.
    Check the following sample code.
    REPORT ztn_test.
    " It is example for list populating.
    TABLES:knvp.
    data: BEGIN OF itab OCCURS 10,
          kunnr like knvp-kunnr,
          END OF itab.
    data: wa_itab like itab.
    TYPE-POOLS: vrm.
    DATA: name TYPE vrm_id,
    list TYPE vrm_values,
    value LIKE LINE OF list.
    PARAMETERS: s_kunnr(20) type c  as LISTBOX VISIBLE LENGTH 40 .
    AT SELECTION-SCREEN OUTPUT.
    SELECT kunnr from knvp  into  CORRESPONDING FIELDS OF TABLE itab WHERE parvw = 'SP'. " SP for ur requirement
    " I have used loop to populate some values from table
    loop at itab into wa_itab.
      name = 'S_KUNNR'.
      value-key = sy-tabix.
      value-text = wa_itab-kunnr.
      append value to list.
      clear wa_itab.
    endloop.
    " If u want individaully assign the values change the code as
    name = 'S_KUNNR'." Select option name
      value-key = 1." Index
      value-text = 'VAL1'.
      append value to list.
    name = 'S_KUNNR'." Select option name
      value-key = 2." Index
      value-text = 'VAL2'.
      append value to list.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING id = name
    values = list.
    Edited by: tahir naqqash on Feb 21, 2009 4:38 PM

  • How to display a value from Select List by default

    I have a Select List on a form and I need to on page load show an entry from the SL depending on the user Id of the user logged on.  For example, if the SL had 3 entries: 'Div1', 'Div2', and 'Div3', depending on the division the user belongs to (I can determine that from his user Id using a SQL), say, I need to display 'Div2' to the user in the SL instead of the usual NULL or '---- Select Div ----'.  'Div1' and 'Div 3' entries will still be part of the SL, but for user's convenience I need to display their division.
    Any ideas?
    Thanks,

    Hi Ajay,
    you need to specify your apex version, database version and so on to make our help specific.
    Anyhow you can create a page process- for example one at On Load before header.
    For example;
    [code]
    declare
      v_division varchar2(32);
    begin
      --select default division
       select my_division
       into v_division
      from my_division
      where my_division=:APP_USER;
    :P_DIVISION:=v_division;
    end;
    [/code]
    Then in the default of your select list, specify P_DIVISION as the default. Using one of several methods
    Understanding Page-Level Items
    Kofi

  • How to get the value from select list to text box

    Hi,
    I have a select list i want to retrieve the value from select list to text box.
    How can i do that???
    Regards,
    Sakthi.

    Hi Sakthi,
    Yo can use the Java script for that..
    Dynamically the value will come into text box.
    Use the below script.
    <script type="text/javascript">
    function disFormItems()
    var lReturn = $v(here your select list name)
    alert(lReturn);
    document.getElementById(here your text box name).value =lReturn; }
    </script>Cheers,
    Shan

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • Dynamic Select List in Reports

    Hi,
    I have come across solutions to implement dynamic Select Lists. But can the same be implemented in a report.
    I have a report of 2 columns which are select lists. The Value of one depends of the other.
    Can this be done?
    Thanks in Advance

    Hi Abdullah,
    Thanks for the Tip. However, couple of queries.
    1) The first modification involves changing the query to : select lov_pkg.savekey() , colA, colB, ... But the function savekey takes a value.
    Ideally, I need this function to be called while loading and when the first select list is changed. How can this be done.
    2) Also, To make this change in query, I had to use (Use Generic Column Names (parse query at runtime only)) option. Now my Add Row button doesnt work? Can you tell me how that can be customized.
    Thanks,
    Sunil

  • Dynamic select list crashes with php

    HI All,
    I can't seem to get a dynamic select list to work in
    dreamweaver. It completly crashes everytime I try adding it to my
    page. I found someone else in the forum who had the same problem
    but no one ever responded. I've tried several things including
    putting just the record set and dynamic select on it's own page
    with no other code on it. It still crashes DW. I also tried coding
    it myself by making a listmenu and modifying it so that the option
    value equals a PHP echo of a value. It crashed there too. Does
    anyone have a piece of code with a working dynamic select list that
    uses a record set that I could look at? That way I can see where
    I'm going wrong. All I'm trying to do is get a simple drop down
    select list of employee names so someone can choose their name to
    get commission. It's a one table, 2 fields (first & last name)
    record set.
    Using DW CS3, php & MySQL.,windows XP Pro
    Any help would be really appreciated!

    AthroughZ wrote:
    > I can't seem to get a dynamic select list to work in
    dreamweaver. It
    > completly crashes everytime I try adding it to my page.
    It looks as though you have a corrupt cache file. Follow
    troubleshooting
    step 4 in the following technote:
    http://www.adobe.com/go/tn_19105
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS4",
    "PHP Solutions" & "PHP Object-Oriented Solutions"
    http://foundationphp.com/

  • Dynamic select list with display,return val & join condition issue.

    hello,
    I am having a dynamic select list with display, return value
    say for example my select statement is
    select distinct dname d, deptno r
    from dept dt
    right join emp e on (e.deptno=dt.deptno)
    where (condition)
    when i tried this query for my select list, it is not working. It saying that
    " LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query. "
    I am not able to understand the problem. Can anyone help me out with this issue?
    thanks.

    Shouldn't your join have dept as the driving table?
    select distinct dname d, deptno r
    from dept dt
    right join emp e on (dt.deptno = e.deptno)
    where (condition)
    Or using older Oracle standard join
    select distinct dname d, deptno r
    from dept dt, emp e
    where (dt.deptno (+) = e.deptno) AND (OTHER WHERE condition)
    OR
    (Since a right join is just getting the values from the driving table that are NOT in the associated table)
    select distinct dname d, deptno r
    from dept dt
    WHERE dt deptno NOT IN (SELECT deptno FROM emp) AND (OTHER where condition)
    Thank you,
    Tony Miller
    Webster, TX

  • Dynamic select list: link to another page

    Hi
    Have following dynamic select list at the bottom in "product.php" page (www.dolls.com.sg)
    <div id="selectcat">
      <select name="Categories">
        <?php
    do { 
    ?>
        <option value="<?php echo $row_rsCategories['categoryName']?>"<?php if (!(strcmp($row_rsCategories['categoryName'], $row_rsCategories['categoryName']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsCategories['categoryName']?></option>
        <?php
    } while ($row_rsCategories = mysql_fetch_assoc($rsCategories));
      $rows = mysql_num_rows($rsCategories);
      if($rows > 0) {
          mysql_data_seek($rsCategories, 0);
       $row_rsCategories = mysql_fetch_assoc($rsCategories);
    ?>
      </select>
    My target is, whenever a visitor clicks on a category in the pull down menu, he is forwarded to the respective "categories.php" page.
    How can I do that?
    Thanks
    Helmut

    Change your code to this:
    <div id="selectcat">
    <form method="get" action="categories.php">
      <select name="Categories">
        <?php
    do { 
    ?>
        <option value="<?php echo $row_rsCategories['categoryName']?>">
        <?php echo $row_rsCategories['categoryName']?></option>
        <?php
    } while ($row_rsCategories = mysql_fetch_assoc($rsCategories));
      $rows = mysql_num_rows($rsCategories);
      if($rows > 0) {
          mysql_data_seek($rsCategories, 0);
       $row_rsCategories = mysql_fetch_assoc($rsCategories);
    ?>
      </select>
      <input type="submit" value="View Dolls">
    </form>
    </div>
    In categories.php, use $_GET['Categories'] to filter the recordset.

  • Creating dynamic select list

    I have a dynamic select list populated by site names and URLs from a map; when a user clicks on an entry the site name and URL will fill two text boxes. There are also buttons to add, update, and delete entries. These buttons lead to actions within my JPF file.
              When I select an entry to delete, the script runs a delete SQL statement again my Ora db instance, then the page content is repopulated. I want to know how come when I do that I always get the sequence ID of the just deleted entry at the end of my select list.
              Here is a snippet of what I've got:
              JSP:
                        <netui:select
                dataSource="{actionForm.siteList[0]}"
                optionsDataSource="{actionForm.itemOptions}"
                size="4"
                tagId="siteList">
              <netui:textBox
                dataSource="{actionForm.title}"
                size="30" maxlength="200" tagId="title"/>
              <netui:textBox
                dataSource="{actionForm.url}"
                size="30" maxlength="200" tagId="url"/>
              <netui:hidden dataSource="{actionForm.key}"
                tagId="key"/>
              <script language="javascript">
                <!--
                <%=session.getAttribute("jsArray")%>
                  function siteClicked()
                    var index =
                      document[getNetuiTagName("process",this)]
                      [getNetuiTagName("siteList",this)][
                        document[getNetuiTagName("process",this)]
                        [getNetuiTagName("siteList",this)]
                        .selectedIndex]
                      .value
                    document[getNetuiTagName("process",this)]
                    [getNetuiTagName("key",this)].value
                      = index;
                    document[getNetuiTagName("process",this)]
                    [getNetuiTagName("title",this)].value
                      = siteArray[ index ][0];
                    document[getNetuiTagName("process",this)]
                    [getNetuiTagName("url",this)].value
                      = siteArray[ index ][1];
                -->
              </script>
                                  JPF:
                        Connection conn = null;
              query = "delete from stlnt_other_ref_sites " +
                      "where stlnt_ors_site_id = " + form.getKey();
              try {
                pstmt = conn.prepareStatement( query );
                pstmt.executeUpdate();
              } catch (SQLException ex) {
              try {
                Map map = new LinkedHashMap();
                while ( rs.next() )
                  map.put(new Integer(rs.getInt(1)), rs.getString(2));
                  jsArray += "siteArray[" + rs.getInt(1)
                    + "]=new Array(\"" + rs.getString(2)
                    + "\",\"" + rs.getString(3) + "\");";
                  hasResults = true;
                options = map;
                getSession().setAttribute("jsArray",jsArray);
                getSession().setAttribute("hasResults",
                  String.valueOf(hasResults));
              } catch (SQLException ex) {
              

    OK I got it working... Mostly... I don't know if it was a combination of changes that made the difference, but I'll put down what I did. First, I switched my select object in the form bean into just a string type from a string array (it was allowing the selection of one entry anyways). Second, rather than just blanking out the options map, I also blanked out the select object [eg form.setSelect("")].
              Now when I select an entry and click delete, the resulting select list is short one visible element. However, you can still select the blank spot where that last entry used to be. However, this is not a huge issue for me now; I will investigate this at a later time.

  • Dynamic select list with one static 'not_listed" option

    Hi guys,
    I want to create a dynamic select list with one static 'not_listed' option.
    One possible alternative is to add the 'not_listed' record into database, but I really dont want to go that way unless there is no other way around.
    Can anyone shed some lights on this?
    Many thanks,
    William

    As usual : "It depends"...
    If you have a foreign key defined on that field, Scott's reply won't work - unless you define '0 - Not listed' in the database. You can use selec 'not listed' d, to_number(null) r from dual though...
    Another - more declarative way - is in the on 'Edit Page Item' page, in the 'List of Values' region set 'Display Null' to 'Yes' and 'Null Display Value' to ' - Not listed - '.
    Roel

  • Cannot make a dynamic  select list

    I couldn't make a dynamic select list in a jsp. please help

    <select name='item'>
                   <option value='-1'>Select Option</option>
    <%
                   rs=stmt.executeQuery("select * from item_master");
                   while (rs.next())
    %>
                             <option value='<%= rs.getString("item_code") %>'
    <%
                             if (rs.getString("item_code").equals(stritemcode))
                                  out.println(" selected ");
    %>
                             ><%= rs.getString("item_description") %></option>
    <%
    %>
                   </select>
    Hope the code snippet helps you. Here stritemcode is the value that should be selected. Amol

Maybe you are looking for

  • Server load balancing for application access using multiple servers

    1.what are the methods supported by cisco switches for load balancing 2. I want to achive users to access 1 particular ip from different locations but phsically few servers which handle the application and data

  • Embedding youtube video in flash with as2 - problem with black bars

    I have successfully embedded the youtube video in my flash code with: //create area to put youtube video on screen this.createEmptyMovieClip("reason1_video", 10000); reason1_video._xscale = 60; reason1_video._yscale = 60; this.reason1_video.loadMovie

  • Problem posting pictures on Facebook?

    After upgrading to Lion I found I could no longer upload photos to Facebook from my iMac. I am brought to what I think is the Finder dropdown menu and cannot maneuver anywhere from there to find and choose the photo I want to post. I have run Lion Ca

  • Urgent - How to add buttons to a Table

    How to add buttons to a Table and enable them for Mouse Listeners/ Action Listeners

  • Database Option not available in UCCX 9.0.2

    Hello there, I  have installed Cisco UCCX 9.0.2 and trying to access Database option  under Subsystems but unfortunately it is not listed under Subsystems  menu. Snapshot is attached.. Is it a licensing issue or something else has to be done? Thanks