Restricting LOV values in tabular form

Hi,
I am new to APEX.
I have a tabular updateable report with the following layout
wagon_no container_no origination destination received_flag wagon_size
wagon123 container123 MLPM DOZ N 20
wagon456 container456 MLPM DOZ N 40
Wagon number,container_number,origination,destination are LOV's and which can be updateable.
Size is read only.
I need to restrict the entry of the wagon's and container in the report.
ie,If wagon Size is 20,then I can enter the same wagon size twice.
If the wagon size is 40,then I can enter the wagon only once for a particular train.
Can it be done at the LOV?
Can it be done through Javascripts..if yes,how can it be done??I have not used Javascript..
Also,the container cannot be entered twice..
I tried restricting the container number in the LOV by not displaying the entered container number in the LOV .But,once saved and while querying later,it doesnot show the correct value.
Can anybody help me out?please,its quite urgent..

Hi,
Have a look at Denie' example on cascading LOV's. this should give you some insight.
http://apex.oracle.com/pls/otn/f?p=31517:42:8068804019748890::NO.
Kind regards,
Iloon

Similar Messages

  • Dynamic LOV in a Tabular Form

    Can somebody please tell me if there is a easy way to code a
    dynamic LOV in a Tabular Form?
    I need the ability to access a column value in the table row, to use in the WHERE clause of LOV query for another column in the row? Seems
    like that should be easy , but not finding an answer.
    Thanks for any help.
    Carol

    Hi Carol,
    You can add the select list's definition directly into your SQL statement using APEX_ITEM.SELECT_LIST_FROM_QUERY - see: [http://download.oracle.com/docs/cd/E10513_01/doc/apirefs.310/e12855/apex_item.htm#CHDIDGDA]
    If you first run your page with your existing select list on it, then do a View Source and look for the select list, you will see a "name" attribute of something like "f01" or "f02" etc. Make a note of the number part of this.
    Then update your SQL statement to include the above and using the number you noted as the Index value (say, 4):
    SELECT EMPNO,
    ENAME,
    DEPTNO,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(4,MGR,'SELECT ENAME d, EMPNO r FROM EMP WHERE DEPTNO = ' || DEPTNO || ' AND EMPNO <> ' || EMPNO) MGR
    FROM EMPThat would give you a select list of employees in the same department as the current employee (excluding that employee themself)
    Andy

  • How to use Ajax Get Multiple Values in Tabular form?

    Hi All-
    I am trying to use AJAX to get multiple values in tabular form by using Denes Kubicek's example in the following link -
    http://apex.oracle.com/pls/otn/f?p=31517:239:9172467565606::NO:::
    Basically, I want to use the drop down list to populate rest of the values on the form.
    I have created the example(Ajax Get Multiple Values, application 54522) on Oracle site -
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    Workspace: iConnect
    login: demo
    password: demo
    I was able to duplicate his example on page 1 (home page).
    However, I want to use system generate tabular form to finish this example, and was not able to populate the data correctly.
    Page 2 (method 2) is the one that I am having trouble to populate the column values. When I checked application item values in Session, and the values seems to be populated correctly.
    This is what I have done on this page:
    1. Create an Application Process On Demand - Set_Multi_Items_Tabular2:
    DECLARE
      v_subject my_book_store.subject%TYPE;
      v_price my_book_store.price%TYPE;
      v_author my_book_store.author%TYPE;
      v_qty NUMBER;
      CURSOR cur_c
      IS
      SELECT subject, price, author, 1 qty
      FROM my_book_store
      WHERE book_id = :temporary_application_item2;
    BEGIN
      FOR c IN cur_c
      LOOP
      v_subject := c.subject;
      v_price := c.price;
      v_author := c.author;
      v_qty := c.qty;
      END LOOP;
      OWA_UTIL.mime_header ('text/xml', FALSE);
      HTP.p ('Cache-Control: no-cache');
      HTP.p ('Pragma: no-cache');
      OWA_UTIL.http_header_close;
      HTP.prn ('<body>');
      HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
      HTP.prn ('<item id="f04_' || :t_rownum || '">' || v_subject || '</item>');
      HTP.prn ('<item id="f05_' || :t_rownum || '">' || v_price || '</item>');
      HTP.prn ('<item id="f06_' || :t_rownum || '">' || v_author || '</item>');
      HTP.prn ('<item id="f07_' || :t_rownum || '">' || v_qty || '</item>');
      HTP.prn ('</body>');
    END;
    2. Create two application items - TEMPORARY_APPLICATION_ITEM2, T_ROWNUM2
    3. Put the following in the Page Header:
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular2(pValue, pRow){
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular2',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM2',pValue)
    get.add('T_ROWNUM2',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM2','null')
        gReturn = get.get('XML');
        if(gReturn){
            var l_Count = gReturn.getElementsByTagName("item").length;
            for(var i = 0;i<l_Count;i++){
                var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
                var l_ID = l_Opt_Xml.getAttribute('id');
                var l_El = html_GetElement(l_ID);   
                if(l_Opt_Xml.firstChild){
                    var l_Value = l_Opt_Xml.firstChild.nodeValue;
                }else{
                    var l_Value = '';
                if(l_El){
                    if(l_El.tagName == 'INPUT'){
                        l_El.value = l_Value;
                    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
                        l_El.parentNode.innerHTML = l_Value;
                        l_El.parentNode.id = l_ID;
                    }else{
                        l_El.innerHTML = l_Value;
        get = null;
    </script>
    Add the follwing to the end of the above JavaScript:
    <script language="JavaScript" type="text/javascript">
    function setLOV(filter, list2)
    var s = filter.id;
    var item = s.substring(3,8);
    var field2 = list2 + item;
    f_set_multi_items_tabular2(filter, field2);
    4. Tabular form query:
    select
    "BOOK_ID",
    "BOOK",
    "SUBJECT",
    "PRICE",
    "AUTHOR",
    "QTY",
    "BOOK_ID" BOOK_ID_DISPLAY
    from "#OWNER#"."MY_BOOK_STORE"
    5. In Book_ID_DISPLAY column attribute:
    Add the following code to element attributes: onchange="javascript:f_set_multi_items_tabular2(this.value,'#ROWNUM#');"
    Changed to -> onchange="javascript:setLOV(this,'f03');"
    Now,  T_ROWNUM2 returns value as f03_0001. But, TEMPORARY_APPLICATION_ITEM2 returns as [object HTMLSelectElement]...
    Please help me to see how I can populate the data with this tabular form format. Thanks a lot in advanced!!!
    Ling
    Updated code in Red..

    Ling
    Lets start with looking at what the javascript code is doing.
    function f_set_multi_items_tabular(pValue, pRow){
      /*This will initiate the url for the demand process to run*/
      var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
                              'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
      if(pValue){
        /*If there is an value than submit item name with value*/
        get.add('TEMPORARY_APPLICATION_ITEM',pValue)
        get.add('T_ROWNUM',pRow)
      }else{
        /*Else set the item TEMPORARY_APPLICATION_ITEM to null*/
        get.add('TEMPORARY_APPLICATION_ITEM','null')
      /*Submit the url and te returned document is of type XML*/
      gReturn = get.get('XML');
      if(gReturn){
        /*There is something returned*/
        var l_Count = gReturn.getElementsByTagName("item").length;
        /*For all elements of the tag item*/
        for(var i = 0;i<l_Count;i++){
          /*Get the item out of the XML*/
          var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
          /*Get the id of the item*/
          var l_ID = l_Opt_Xml.getAttribute('id');
          /*Get the element in the original page with the same id as
          **the item we have in the XML produced by the ondemand process
          var l_El = html_GetElement(l_ID);
          /*Now get the value of the item form the XML*/
          if(l_Opt_Xml.firstChild){
            var l_Value = l_Opt_Xml.firstChild.nodeValue;
          }else{
            /*There is no value*/
            var l_Value = '';
          if(l_El){
            /*There is an element with the same id as the item we are processing*/
            if(l_El.tagName == 'INPUT'){
              /*The element is an input item just set the value*/
              l_El.value = l_Value;
            }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
              /*If it is a span elment and has the class grabber
              **Then set the innerHTML of the parent to the value
              **and the id of the parent to the id
              l_El.parentNode.innerHTML = l_Value;
              l_El.parentNode.id = l_ID;
            }else{
              /*Else set the value as innerHTML*/
              l_El.innerHTML = l_Value;
      get = null;
    Now where it went wrong in your initial post
    The XML that was returned by your XML process would be something like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_1">CSS Mastery</item>
      <item id="f03_1">22</item>
      <item id="f04_1">Andy Budd</item>
      <item id="f05_1">1</item>
    </body>
    When you don't use apex_item to create your tabular form a item in the table will look like
    <input id="f02_0001" type="text" value="CSS Mastery" maxlength="2000" size="16" name="f05" autocomplete="off">
    Notice the id's f02_1 and f02_0001 don't match.
    So to make it work the XML would have to look like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_0001">CSS Mastery</item>
      <item id="f03_0001">22</item>
      <item id="f04_0001">Andy Budd</item>
      <item id="f05_0001">1</item>
    </body>
    To do that simply use lpad in the ondemand process like
    HTP.prn ('<item id="f02_' || lpad(:t_rownum,4,'0') || '">' || v_subject || '</item>');
    HTP.prn ('<item id="f03_' || lpad(:t_rownum,4,'0') || '">' || v_price || '</item>');
    HTP.prn ('<item id="f04_' || lpad(:t_rownum,4,'0') || '">' || v_author || '</item>');
    HTP.prn ('<item id="f05_' || lpad(:t_rownum,4,'0') || '">' || v_qty || '</item>');
    Keep in mind that the above is based on your original post and #ROWNUM# not being lpadded with zero's.
    Nicolette

  • How to fetch the value of tabular form item in javascript

    Hello all
    I want to do some calculations on the value entered by the user in the textfield of a tabular form, how can I fetch the value of tabular form item in the javascript?
    I am using normal tabular form, not using apex_item tabular form.
    I can pass the current textfield value to the function using "this" as a parameter, but how can I fetch the value of other rows of that same column?
    Thanks
    Tauceef

    Hi Alistair
    jQuery is still not working, but I got it done through some other means, this is the code:
    function total(pThis){
    var l_Row = html_CascadeUpTill(pThis,'TR');
    var l_Table = l_Row.parentNode;
    var l_Row_next = l_Row;
    var n_rows = l_Table.rows;
    var lInputs;
    var v1;
    var sum = 0.0;
    var temp;
    var i = 0;
    var j = 0;
    //alert(n_rows.length);
    while(j < (n_rows.length - 1))
    temp = 0;
    if(l_Row_next != null){
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    //alert(v1);
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    temp = 1;
    if(temp == 0){
    l_Row_next = l_Table.getElementsByTagName('TR')[1];
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    j= j+1;
    $x('P78_TOTAL').value= parseFloat(sum);
    I am calling this function onblur event of the textfield.
    Still I am having one problem, I want to perform this calculation on load of the page also, how can I do that? because while calling onblur of the textfield I can pass that textfield to this function but on onLoad how I will pass the textfield to call this function so that I will be able to get the textfield value in the function?
    there may be some rows already existing, so I want the total of the existing rows to be displayed in my P78_TOTAL textfield that is why I need to do this calculation on onLoad of the page.
    Thanks
    Tauceef
    Edited by: Tauceef on Jul 8, 2010 4:57 AM

  • How to retain value in LoV item in Tabular Form, after Page Refresh

    Hi,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, 2nd item(column) in tabular form, that LoV should get populated based on user's selection value in first item LoV.
    1. So how do I refer to the value, that user selected in first item's LoV? I will have to use this value as reference in LoV query of my 2nd item ( on this tabular form)
    2. Everytime I select value in first item LoV, page gets refreshed, as my requirement is to calculate 2nd item's LoV based on selected value in first item. So after this page refresh, first item LoV loses its value that was selected before the page refresh happened. So how do i retain this value in first item LoV? I have an unconditional process, that on every submit(refresh) of page, I set all my items with their corresponding values. But problem is what do i mention there to refer to this first item ( of type LoV) of tabular form?
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Please help.
    Thanks and Regards,
    Ravi.

    Hi Rave,
    You will have to use Javascript and Ajax to change the values as ApEx submissions will lose your results unless they are saved into the database.
    Remember, that as you are using a tabular form there will be lots of items called f01, fo2, fo3 etc on the page (one per row).
    Regards
    Michael
    Edited by: MKii on Jun 4, 2009 10:13 AM

  • Why doesn't a Popup Key LOV (named LOV) in a tabular form not display values in the popup?

    I have a tabular form and I'm setting one of the fields to a Popup Key LOV (named LOV). The named LOV is a static LOV. When the popup is displayed there are no values displayed. The same thing happens if I use a Popup LOV (named LOV).
    I created a sample application http://apex.oracle.com/pls/apex/f?p=15762:1that shows what happens. When the job field popup is selected, no items are displayed. If I change the item to a Select List (named LOV) it works fine.
    Is this a bug?

    Hi
    I am also getting the same issue. Hope it could be a bug.
    Can anyone plz confirm this?
    Thanks
    Lakshmi

  • Use value from tabular form column in the LOV where clause of another column

    Hi
    Using APEX 4.2 on 11g
    In a tabular form I want to filter the values in a Popup Key LOV based on the value of another column (same row).
    i.e. I want to get the value of one column and use it in the where clause for the Popup LOV on the same row.
    e.g. where COL 2 is a popup LOV
    COL 1
    COL 2
    1
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    2
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    3
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    The value in COL 1 does not change once the row is created. It is a hidden ID field.
    Is this possible?
    Nick

    Anyone have any ideas?
    I thought getting the value from one column and using it in another column would be commonly used functionality... I just can't seem to work it out.

  • How to restrict user to not enter same value in tabular form

    Greetings !
    i m asking second time the questiion because i was not answered preivously, so please dont mind if it is a duplicate one,
    question was: i created tabular form as shown in example.
    i want to validate username as you see in my example to restrict user to enter the same value in username field before submit page.
    e.g when user is entering data as u see test in username in first row, when he/she goes to second row and type the same username like test " message will appear or restrict user that already typed or in use"..
    http://apex.oracle.com/pls/apex/f?p=45296:1:22797340776918:::::
    this all be done on typing before submit record.
    please gudie

    Hi,
    i m asking second time the questiion because i was not answered preivously, so please dont mind if it is a duplicate one,question was: i created tabular form as shown in example.
    i want to validate username as you see in my example to restrict user to enter the same value in username field before submit page.
    e.g when user is entering data as u see test in username in first row, when he/she goes to second row and type the same username like test " message will appear or restrict user that already typed or in use"..
    http://apex.oracle.com/pls/apex/f?p=45296:1:22797340776918:::::
    this all be done on typing before submit record.>
    Stick the below code in the Page Header > Javascript > Execute when Page Loads field.
    $('[input[name="f03"]').blur(function(){
      if ($('input[name="f03"][id!="'+$(this).attr('id')+'"]').val() == $(this).val()) {
         alert('Duplicate Entry.');
         var x = $(this).attr('id');
         setTimeout("(function(p){$('#'+p).focus();})('"+x+"')",100);
    })Note :
    a.f03 is the "name" of your username column in the Tabular form.
    b. This validates only the displayed values . If your Tabular Form has multiple pages then all the rows not currently displayed will be ignored.
    Cheers,

  • Set value in tabular form field with dynamic action

    Hi Guys,
    I have a dummy field in a tabular form which I am trying to use to populate another field in the tabular form when it is changed.
    In the tabular form I have an ITEM_ID field. Each item_id has an ITEM_NAME which is the dummy field as it is not a field in the database table.
    When the user enters an item name, I would like something like a dynamic action to fire, populating the ITEM_ID.
    e.g User enters part no ABC into the dummy field. When they tab out, I want the value to the item_id field on the tabular form row to be populated based on a SQL query in a similar fashion to how it can be done with dynamic actions on text items on a form.
    I am using APEX v4.0.0
    Thanks in advance
    Chris

    Hello Chris,
    Why can't you use Select List Item on tabular form, which will display all item_names and return item_ids?
    If the list is huge and you need users to type & search, then you can use Pop-up LOV item.
    Regards,
    Hari

  • Specify image for a pop-up LOV in a tabular form?

    Hi,
    I am using a tabular form for users to edit data. One of the fields has too many options to use a select list, so I have to use a pop-up lov (query based)... grrrr
    The lov shows up in my form as [Field value]List
    I would like to remove the text "List" and put a small icon there. Where can I specify the image source?
    Thanks,
    Rob

    Hi Denes,
    Thanks for your reply. I looked at your page, but I'm not sure if it relates to my issue.
    Here's a piece of the generated HTML for the pop-up lov:
    &lt;span class="lov"&gt;
    &lt;label class="hideMe508" for="f03_0004"&gt;f03_0004&lt;/label&gt;
    &lt;input id="f03_0004" type="text" value="U41" maxlength="2000" size="8" name="f03"/&gt;
    &lt;img align="middle" style="vertical-align: middle; cursor: pointer;" alt="List"/&gt;
    &lt;/span&gt;Notice that there is an image tag, but the src attribute is not there...as a result the browser displays the alt text List.
    If I missed your solution I apologise...

  • Cascading LOV in a Tabular form

    Hi Guys,
    I have read numerous articles on the generation of cascading LOV's in a tabular form but havent been able to get it working
    I have created an example in my apex workspace at:
    http://apex.oracle.com/pls/apex/f?p=4000:1500
    workspace XXAPPS
    Username guest
    Password demo
    app no 17551
    Page 2
    In my test scenario, I have an emp table, dept table and an office table.
    Within my tabular form(based on the emp table), I have a deptno column and an office column.
    Depending on what the user selects in the deptno column, I would like the corresponding list of offices associated to that dept LOV to be returned in the offices LOV.
    The table structure is
    EMP
    EMPNO
    ENAME
    JOB
    MGR
    HIREDATE
    SAL
    COMM
    DEPTNO
    OFFICE_ID
    DEPT
    DEPTNO
    DNAME
    LOC
    OFFICE
    OFFICE_ID
    OFFICE_NAME
    DEPTNO
    When the user selects a deptno in the LOV I would like that to control the values that are returned in the office LOV.
    I have used Jari's blog post:
    http://dbswh.webhop.net/dbswh/f?p=BLOG:READ:0::::ARTICLE:2003800346210117
    but as you can see it isn't quite working in that the office LOV is not returning anything.
    I am pretty new new to JavaScript and jQuery so am no doubt doing something wrong as some of the steps are causing errors and are confusing me a bit e.g. step2 is causing the page to return blank (I have commented the code out in the example)
    Any help would be greatly appreciated.
    Thanks
    Edited by: Cashy on 07-Mar-2012 04:05

    Hi fac,
    That is the full code as per the Jari's link on http://dbswh.webhop.net/dbswh/f?p=BLOG:READ:0::::ARTICLE:2003800346210117 (last but one section of instructions).
    I have got the id of the elements (f07 and f06) by using IE Developer toolbar and have passed those into the dynamic action.
    The child element is now just showing loading...
    It seems to me that the on demand process is not being called because I changed the code to:
    DECLARE
    l_sql VARCHAR2(32700);
    BEGIN
    IF APEX_APPLICATION.G_x01 IS NOT NULL OR APEX_APPLICATION.G_x01 IS NULL
    THEN raise_application_error(-20001,'code gets here');
    l_sql := 'SELECT competency_id AS RET
    ,competency_description AS DIS
    FROM XXMEL_FOCUS_COMPETENTCIES
    WHERE competency_category_id = ' || APEX_APPLICATION.G_x01 || '
    ORDER BY competency_description
    APEX_UTIL.JSON_FROM_SQL(l_sql);
    ELSE
    HTP.prn('{"row":[]}');
    END IF;
    just to see if the code is getting to the process but the error message that I put in the PL/SQL is not firing.
    Chris

  • Re-enable column values in tabular form before submit

    Hi,
    I am using Apex 4.1. I have a tabular form. I created a dynamic action to disable some of the columns on page load.
    It works fine and I am able to add new rows. But when I click submit, all the column values are null and it is throwing validation error.
    I need to enable all the columns before submit. I invoked a javascript to enable all the fields, but still i get the validation error.
    I also tried creating dynamic action to enable the values but still I get the validation error becuase the values are all null.
    Please help me to resolve this issue.
    Thanks
    SR

    Per HTML standards, disabled items are not submitted. Therefore if they are disabled at the point of submit, their corresponding session state values will be null (as you discovered). Apex validates against what is is session state, not against what is on your screen, so since the values didn't get submitted (per standards for HTML disabled items) that's why Apex thinks they are null.
    Before submit, re-enable the items/columns and it should work fine.
    Edit: Sorry, looks like you are doing this already. But are you doing it in the right order?
    How I have done it is:
    1. Change the save/apply changes button (whatever is doing the submit) to call a URL.
    2. Make the URL call javascript, such as:
    javascript:formSave('SAVE');
    3. Put a javascript function on your region or page (hypothetical example):
    <script type="text/javascript">
    function formSave(pRequest)
    { //Put all checking and processing prior to form save here.
      var vRequest="SAVE"; //default value taken from orig. "apply changes" button
      if(pRequest)
        vRequest=pRequest;
      enableAllCells(gMaintActionCol); //Put whatever code you have to re-enable your tabular form items here, must fire before apex.submit.
      //Do the save
      apex.submit(vRequest);
    </script>Edited by: gti_matt on Dec 1, 2011 3:04 PM

  • Using select list as default value in tabular form.

    Hi,
    I am using Application Express 4.1.0.00.32. I have two questions that are related.
    I have a Select item *'P1_SELECT'* and a tabular form My Items.
    Question 1. The My Items tabular form col1 Attributes are set Display As Text Field, and the Tabular Form Attributes are set Default Type = item(application or page item name), Default = P1_SELECT. I have checked the session state value is set on P1_SELECT ie. Fred. What I need to know is, why, when adding a row to the tabular form My Items does col1 not display 'Fred' as the default value from the select item P1_SELECT? I can change col1 of the Tabular form to be Display as Text (save state) and this will work. However that leads me on to:
    Question 2. After adding say 3 rows to the form, I then change the select P1_SELECT value to Bob and Bob is now set in session state on the P1_SELECT item, but when I again add row to the form the value Fred is still the value not Bob. It seems that the tabular form keeps the default value as Fred and not Bob. How can I get this to look or work like:
    col1_
    Fred
    Fred
    Fred
    Bob
    Your help is needed.
    Thanks.

    Howard (DBA in Training) wrote:
    Do you submit the page or set the value after changing the selection? If not, the display value seems to be Bob but the working value is still Fred. That's what you are seeing right? In the "Settings" section, what do you have for "Page Action when Value Changed". I've been using "Redirect and Set Value" because I was staying on the same page after the selection.
    Additional info which might be helpful (or NOT). ====================
    NOTE: I am just a novice's novice with APEX and I had much agony with Select Lists. It was challenging to have the Select List value displayed because there seem to be so many different sources of the Select List value, namely:
    1) the current value in the session state
    2) the value you can specify in "Source value or expression" in the "Source" section of the Select List item
    3) the value you can specify in the "Post Calculation Compution" in the "Source" section of the Select List item
    4) the value you can specify in the "Default value" of the "Default" section of the Select List item
    [Now, if I've misdescribed any of these, remember, this is from a novice's perspective.]
    It's like putting a clock (back) together. Get any of the pieces wrong and it will probably not work right.
    I had an addiitonal challenge in that I wanted the same Select List displayed on multiple pages and for the currently selected value (from the former page) to already be set on the new page when it was displayed. What fun!
    To see what I did here: http://apex.oracle.com/pls/apex/f?p=43250:101 login Dever/Ima9Dever
    Remember, I'm doing many things you will likely not need to do. I iniitalized the Select List for the first time it displayed. I copied the Select List value from old page to new page by storing it in an application item F217_SYS_NIC_NM.
    Best wishes,
    HowardHi Howard,
    You don't have submit the page for just setting one item's session state. you can use a Dynamic Action OR use Page Items to Submit property if available (this is available in various places such as sql region,chart region etc)
    In context to this question you don't have to do any of those..just see my example above
    Thanks

  • A default value in tabular form

    Hi all,
    I have a simple tabular form, and i'd like that if a certain field doesn't contain any value to fill it with a default value.
    I tried to do it via default value attribute, but i'd like it to take place in a certain record in the table and not in all the records (which i can identify by a key, e.g. id)
    how would you do it????
    Liron

    Hello Liron,
    >> when i submit the page, it doesn't take the default value (which indeed appear on screen) but null
    Well, if this default value is the only “change” in this row, it will not be updated into the table, because the tabular form mechanism is not detecting any changes in this row – remember, as far as the tabular form goes, this is the original value of the cell.
    However, it seems like you want this default value to be saved, regardless of other possible activities of the tabular form. In this case, you should run the update prior to rendering the tabular form. You can use a before header PL/SQL block to do that. Using the EMP example, you can use a similar code in your pl/sql block:
    update emp
    set comm = 10
    where comm is null and deptno=20This pl/sql block will run prior to your tabular form query, and all the updates will be reflected in the rendered result. Now you can continue to work with the tabular form to enter the rest of the changes you need (including deleting the new default values).
    Don’t forget to change the tabular form query back to its original form. If you are using this technique, you don’t need the CASE statement.
    Regards,
    Arie.

  • Setting default value of Tabular form item is not working

    Hi,
    I have a tabular form and in that I want to set the default value of the username to app_user. So in the default value of the item, I wrote v('app_user') and type Pl/SQL, but that does not seem to work. I tried the static application & page item with :app_user. That threw an error.
    Also, I wanted to populate the date field in one column. Doesn't sysdate work?
    Thanks,
    Sun

    Bob, I did read that. MY problem is that it is still not working. I am wondering if this is because the table is in execute query mode maybe? I am wondering if the default value needs to be added after the tabular data is populated through some other way? Maybe the default value would work only for static non database items?
    ThanksYou're right, I just tested that using the default setup on the column in report attributes and it did not work.
    I think you'll have to update the columns with the default value post query but I'm not sure exactly what you need to do.
    I have a form that has a weight entry column. I tried changing the query to set the default value in the query
    from..
    Select Weight
    From...
    to
    Select 999.99 Weight
    From...That appeared to work, but the 999.99 value was not populated back to the Database since it wasn't entered through the form UI. APEX maintains the entered values internally so it can do its checksumm processing and update modified rows back to the DB. I'm thinking you could update what needs to be updated using Javascript in a Dynamic Action, but I'm afraid I don't know how to do that.
    Excuse my incorrect assumption when first replying.

Maybe you are looking for