Select item on a Tabular form with a different dynamic LOV on each row

I would like to use a tabular form where one of the columns is a dynamic LOV based Select, and where that dynamic LOV refers to one of the column values on each row.
So if the tabular form represented a list of teams and the LOV-based Select column was the current team leader, I would want that select list to be populated only with the members of that team (different for each row). Since the list of team members is in some other table (all_players or something) I would want to populate the LOV with a query with a where clause that selected only those players records with a team-membership equal to the current tabular form's team id. So, on each row that select list's contents would be different.
-- Justin

I'm beating a dead horse here but I did get something to work with "less" code. My current needs do not require me to cascade drop downs, I only want 1. You can use the query like the in the first reply (but I don't have a table with joins) I created a simple two column table dept_emp with 4 records 10,null 20,null .... I want to fill the nulls with an employee but ONLY an employee that matches the dept. (Same concept of team leader and members).
Here's the query:
select apex_item.display_and_save(1,dept) dept,
apex_item.select_list_from_query(2, name, 'select ename from emp where deptno='||dept) name
from dept_emp
I removed the code that was there already (ApplyMRU) and just put in this code:
BEGIN
FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
UPDATE dept_emp
SET
name=HTMLDB_APPLICATION.G_F02(i)
WHERE dept=to_number(HTMLDB_APPLICATION.G_F01(i));
END LOOP;
END;
The G_F01 matches the column 1 and so forth. There's more documentation but little explanation at:
http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/api.htm#sthref2171
The thing I could not get to work was a dynamic message
#MRU_COUNT# row(s) updated, #MRI_COUNT# row(s) inserted.
Not sure when the MRU_COUNT gets populated (probably in the routine I removed ;))
You're probably way past me by now but I like to have as little code as possible when it comes to maintaining an app. That's why I liked oracle forms so much. This kind of stuff was pretty easy to do.
Thanks again everybody!

Similar Messages

  • How to refresh page after selecting value from LOV item , in a tabular form

    Hi ,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, couple of issues here.
    1.
    2nd item(column) in tabular form, that LoV should get populated based user's selection value in first item LoV. So how do i refer to the value, that user selected in first item's LoV? I will have to use this reference in LoV query of my 2nd item ( on this tabular form)
    2.
    How can we refresh the page, when user selectes value in first item ( from LoV). As this is a tabular form, here item type is Select List, we dont have an option to pick item type as Select List with Submit. So problem is that when user selects value for item 1, refresh does not happen and item 2 LoV does not get populated as per user's selection in item 1.
    Please help here. Would be really appreciated.
    Thanks and Regards,
    Rave.

    Thanks Ben and Dan for your responses.
    Ben, your solution helped me with refresh of page, as page got submitted.
    This answers to my 2nd question. However, I still need to know first question, which basically is, how do i refer to the value, that user selected in first item LoV.
    Issue is, I selected the value in first item LoV, it got submitted and page fot refreshed. But after page refresh, first item LoV loses its value that I had selected last time. It does not retain the selected value after refresh.
    I have an unconditional process, that on every submit(refresh) of page, I set my items with their corresponding values. But problem is what do i mention there to refer to this item.
    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).
    Any help here would be really appreciated. Please suggest how do we refer to this item's selected value.
    Thanks and Regards,
    Ravi.

  • Tabular form with select list not updating

    I have created a tabular form with a dynamic select list
    select primary_key, column1,
    htmldb_item.select_list_from_query(10,column2, 'select descr d, column_value r from lookup_table where column_value = '||column1) column2
    from main_table
    The select list appears to work correctly but the new value is not saved to the database. I assume this is because the tabular form element display as field for column2 is set to "standard report column" but when I select any of the "display as text" or "LOV" options either the current data is not displayed or errors are generated.
    Any suggestions?
    Thanks,
    Bob

    Hi Ian,
    As you have seen, sorting on the project_manager_id column will sort by the id value rather than the textual value. This is, of course, because this is the value in the field.
    I haven't tried this out, but one thing that may work is the fact that you don't have to include the ORDER BY fields within the SELECT statement. You could, for example, do:
    select p.project_number, p.project_manager_id
    from projects p, users u
    where p.project_manager_id = u.id (+)
    order by u.name
    Obviously, you won't be able to do this in the existing statement as you would then be blocked from using column sorting. However, it implies that if you could construct the SQL statement dynamically, appending appropriate ORDER BY strings to the end of the base select statement, you could sort by anything you like. This does, of course, mean that you would have to create a mechanism to allow the user to select the sort order, generate the appropriate string and reconstruct the entire sql statement.
    I had had a similar request quite a while ago. The underlying reason for that request turned out to be that the user just wanted to quickly locate records relating to one person. In the end, we agreed that a search filter was the best thing to do.
    Regards
    Andy

  • Select List in a Tabular Form

    Hello all,
    Using APEX 4.1 on Oracle 11.2 SE (Oracle Linux Server release 6).
    I have a Page with a region based on a Tabular Form.
    The Region Source query has various columns, including an ID. I have also added a DATE column and a "Button" column which appear on every row.
    The extra DATE field is displayed as a Select List on a Named LOV.
    The extra Button field is displayed as a standard report column, and has Column Link attributes which cause it to branch to another page when pressed.
    What I want to happen is that when the user presses the button on one of the rows, APEX sets two application items before going to the new page:
    1. the ID column for the row in which the button was pressed
    2. the value currently highlighted in the Select List, for the row in which the button was pressed
    Using a Column Link item value of #ID# I can successfully get hold of the ID column for the correct row.
    But doing the same for the Select List column invariably returns the default value of the Select List (i.e. the initially-selected value). It doesn't pick up the change if the user has gone into the Select List and chosen a different value.
    Can anybody advise the easiest way to acquire the selected value in a Select List in a Tabular Form?

    Thanks for the reply!
    To get this working I did the following:
    1. Used APEX_ITEM.SELECT_LIST_FROM_LOV(... p_item_id=>'LOVI_'||TO_CHAR(id) ...) in the base query, to generate the LOV. (Note: the ID column is the primary key, so no need to use a ROWNUM column)
    2. Added a Standard Report Column with the following settings:
    Link Text = <img ... >
    Link Attributes = Empty
    Target = URL
    URL = javascript:window.location.href = 'f?p=&APP_ID.:123:&SESSION.::::ID,SELECTED_STRING:#ID#,'+$v('LOVI_'+'#ID#');
    So when the link is pressed, the JavaScript is invoked and it evaluates to the value currently present in the uniquely-named <select> item.
    Ian

  • ADD ROW in tabular form with new max value for a certain field

    All,
    I have a tabular form with an 'ADD ROW'-button.
    When a row is added the field 'TemplateID' should get
    automatically a new value which is MAX from TEMPLATEID + 1.
    I would be very glad, if someone has a hint for me.
    Thanks in advance,
    lucio

    Hi
    the cause of not seeing the 'Default Item Field' is,
    that during creation of a 'Tabular Form' the column with the
    primary key doesn't get that feature, why so ever.
    I still hope that someone could give me a hint why that code isn't working:
    function SetNewID(vDBID)
    v_check = $v('P20_MAX_TEMPLATEID');
    pNd = $u_Carray(vDBID);
         for(var i=0;i<pNd.length;i++){
              var node = $x(pNd);
              node = $x_Check_For_Compound(pNd[i])
              var lTr = $x_UpTill(node,'TR');
    updateRow = lTr.rowIndex - 1;
    document.wwv_flow.f02[updateRow].value=$v(v_check)
    Many thanks in advance
    lucio                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Tabular Form with user supplied PK

    apex: 3.2.0.00.27
    Hello,
    I need create a tabular form. The pk will be provided by the user. SO I see that I will need to specify the PK as being a trigger populated PK.
    The pk is USER_ID. The wizard created two columns for user_Id. The first(user_id) is hidden the 2nd user_id_display in read only.
    What do I need to do so the user can provide the value for the PK? I assume I need to change one of these into an updateble field. WHich USER_ID?
    I did that and when I enter a value for the PK(USER_ID) and select submit I get this error:
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "A884FA378C851786DDFE3A33709CB23C", item checksum = "AB737A81A58CD50BDE3015EC8BE7350C"., update "BIDIDEV"."TB_BD_USER" set "USER_ID" = :b1, "BID_ADMIN" = :b2, "BID_MATERIAL" = :b3, "UPDATE_FILTER" = :b4, "PROJECT_FILTER" = :b5, "BID_SRADMIN" = :b6, "PROGRAM_COORDINATOR" = :b7IT looks like its trying to do an update instead of an insert.
    As a follow up to this question. I then want to base the value for the PK on an LOV. So do I just change the column type to select list?

    Hi,
    Tabular Forms in APEX do currently not support PKs that can be entered or modified by the user. The PKs are what's used to identify to rows to update. And for new rows, the PK must be NULL in order for APEX to be able to identify the row as a new row. If you need this column to be modifiable by the user, I suggest adding another column to the table as the actual, internal primary key column, have that column be populated by a trigger, and then make your current PK column a regular, editable column. If that's not possible, you will have to remove the generated multi-row update and delete processes, and implement your own PL/SQL based page process to perform the updates, inserts and delete.
    While I believe PK columns should never be editable by the user, and PK values should always be system generated, I realize that not all APEX developers gets to design the underlying database design, nor are they always able to make any modifications to that design. So in APEX 4.1, we'll add the ability to use the internal ROWID for DML processes, which then will allow developers to use PK columns however they wish. Of course APEX 4.1 is still in development, and we don't have a release date yet.
    Regards,
    Marc

  • Apexlib tabular form with lov gining ora-00900

    Hi,
    When I add a tabular form with 3 items and chagne two of them to a LOV display item I get the following error:
    ORA-00900: invalid SQL statement
    Debug:
    1: begin
    2: ---------------------------------------------
    3: -- Get metadata of page
    4: ---------------------------------------------
    5: ApexLib_Page.generateBrowserData;
    6: ---------------------------------------------
    7: -- Get metadata of items and tabular forms.
    8: ---------------------------------------------
    9: ApexLib_Item.generateBrowserData;
    10: ApexLib_TabForm.generateBrowserData;
    11:
    12: ---------------------------------------------
    13: -- Send data for cascading lovs
    14: ---------------------------------------------
    15: ApexLib_Lov.generateBrowserData;
    16:
    17: ---------------------------------------------
    18: -- Send NLS data for date formats and numeric
    19: -- format masks and translated error messages
    20: ---------------------------------------------
    21: ApexLib_Browser.setNlsData;
    22: ApexLib_Browser.setApexLibMessages;
    23:
    24: ---------------------------------------------
    25: -- Active different navigation improvements
    26: ---------------------------------------------
    27: ApexLib_Browser.setLovIconsNonNavigable;
    28: ApexLib_Browser.setLRButtonIconsNonNavigable
    29: ( pLeftClassName => 'L'
    30: , pRightClassName => 'R'
    31: );
    32: ApexLib_Browser.checkForLovKey;
    33: ApexLib_Browser.checkForUpDownKey;
    34:
    35: ---------------------------------------------
    36: -- Active different UI improvements
    37: ---------------------------------------------
    38: /* optional
    39: ApexLib_Browser.setTextareaProperty
    40: ( pProperty => ApexLib_Browser.VERTICAL_RESIZEABLE
    41: );
    42: */
    43: ---------------------------------------------
    44: -- Init browser validation
    45: ---------------------------------------------
    46: ApexLib_Browser.initValidation
    47: ( pShowRequiredWarning => TRUE
    48: );
    49: ---------------------------------------------
    50: -- Has to be the last statement!
    51: ---------------------------------------------
    52: ApexLib_Browser.flushJsBuffer;
    53: end;
    Any idea?
    Erwin

    I solved it.
    I modified a bit my code "On load Page". In case of LOV i have changed this condition
    if (l == undefined) {
              document.wwv_flow.f03.disabled = true;
          }with this
    if (l == 105) {
              document.wwv_flow.f03.disabled = true;
          }I don't know why 105 instead of undefined, but this works. I give 105, with alert on length.

  • Bug: 4.1.1 Tabular form with all columns conditional

    I need to make all the columns in a tabular form conditional because in some situations the editable elements should not be shown. For some reason just changing the columns to conditional stops the form working, the ApplyMRU/ApplyMRD process runs but does not action the changed rows. I can't figure out why at all or any workaround.
    You can easily reproduce this in 4.1.1 by creating a tabular form with the wizard selecting one column in the form. Then make the row selector colunn and your editable column conditional using the plsql expression 1=1. The form is displayed the just the same with these true conditions but it doesn't work. How weird is that?
    Rod West

    Rod,
    In your scenario the tabular form rendering engine is unable to place the hidden, internal tabular form status columns in your form, i.e. the columns that contain checksums, etc. The logic that places these columns looks for the last unconditional, visible column in your tabular form, and includes the hidden fields there. So you need at least one column that's always shown for this to work. This can be an otherwise empty column. I filed a bug (#13881803) for this, so we can look into improving this logic.
    Regards,
    Marc

  • Tabular form with onhover comment column

    Hi guys!
    I was wondering if anyone of you saw an example of onhover item help with query...I mean..lets imagine a tabular form with a text field Comment column. Comment column has width 50 but we all know that comment ale like to be long ;) I'd like to see full lenght comment every time I put my mouse pointer on a specific row. Is it possible ? If yes can you show me an example or point me in a good direciton...(I dont know javascript well..)
    With regards,
    PsmakR

    PsmakR,
    Yes it is possible. Currently the ShowPopup script displays the value of current cell (hv_item.value). You can just simply replace with whatever you like.
    If you're talking about the value of other columns, you may have to use document.wwv_flow.fXX to refer to it. Again, see my other sample of [Tabular Form Column Read-only|http://apex.oracle.com/pls/otn/f?p=57043:4] . Patrick Wolf wrote about this as well in his [ Which Tabular Form Column is mapped to which Apex_Application.g_fxx array|http://www.inside-oracle-apex.com/which-tabular-form-column-is-mapped-to-which-apex_applicationg_fxx-array/] .
    Ittichai

  • Items on a tabular form

    hello,
    i want to add a validation to a page, where i definied a tabular form with several editable fields.
    If i try to add a validation to an item to that page, apex doesnt find any items?
    How can i reach the tabular form items ?
    Would be glad about some help
    phil

    Hi Phil,
    you can also take a look at my ApexLib Framework which has some enhancements for the handling of Tabular Forms.
    http://inside-apex.blogspot.com/2006/12/plug-play-tabular-form-handling.html
    http://inside-apex.blogspot.com/2006/12/accessing-row-selector-of-tabular-form.html
    http://inside-apex.blogspot.com/2007/03/min-max-value-validation-in-browser.html
    http://inside-apex.blogspot.com/2007/02/restrict-input-length-for-tabular-form.html
    For a full list of features see http://apexlib.sourceforge.net/
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com
    Check out the ApexLib Framework: http://apexlib.sourceforge.net

  • Row selector select all default in Tabular Form

    Hi,
    I am a newbie to APEX using 4.0. I have a tabular form with the default "row selector". Our requirement is to have the checkbox in the row selector column automatically checked when the tabular form is rendered, so that they can uncheck the lines that they do not want to select. The tabular form will have many records displayed on multiple pages. How can I select all in the row selector when the page is rendered?
    Thanks a lot for you help.
    Ed

    Ed,
    Create an on load dynamic action that executes the following javascript code:
    var elm = $x('check-all-rows');
    elm.checked = true;
    checkAll(elm);Cheers,
    Tyson Jouglet
    Edited by: Tyson Jouglet on Jun 24, 2011 7:00 AM

  • Tabular form with non base table field

    I want to develop a tabular form with
    1. A non-base table edit field to accept a value
    2. Insert/update another table based on the input value
    3. Also, computed field on each row based on other fields on the records (like post-query trigger in oracle forms at block level - for each row)
    Thanks,
    Rachna

    Thanks for your reply.
    Varad, I like the link you sent me. It has a lot of good information.
    I created a process (under page processing) called "Update/Insert Process" that dosn't seem to be working.
    Question, I created a manual tabular form with SQL Query and created a process (under page processing) called "Update/Insert Process", then I check for each record in the tabular form. If the old value <> new value then I update/insert in the new table.
    Any step by step will be highly apprciated - to create process/validation etc.
    Thanks,
    Rachna

  • Tabular Form with Popup List Error

    hi,
    am using javascript to display Department Name when Deptno is changed in the Popup List
    am getting message from Popup Item (DEPTNO) (Htlm Form Element Attributes -> onchange="getDname(this); ")
    but am not getting message from popup Item in the Tabular Form ,
    am calling same javascript funtion in both the Popup Item(Column Attributes/Element Attributes->onchange="getDname(this); ")
    but am getting message from LOV item in the tabular form, am calling same function (Column Attributes/Element Attributes->onchange="getDname(this); ")
    u can check from the following URL:-
    http://apex.oracle.com/pls/apex/f?p=17935:12
    Username/Password : test/test
    Is there an setting i need to change in Popup Item in Tabular Form?

    Still nobody knows what the bug in Tabular Form
    CAN ANY ONE HELP ME ?

  • Error tabular form with validation

    Hi everyone,
    I have built a tabular form with the wizard and I every time a validation check is done and fails,
    getting an error in the place where the tabular form should be. I get to see the tabular form again when pressing the cancel button or refreshing the page.
    I'm not quite able to reproduce this error, but I was wondering if anyone knows of this error and a workaround for it.
    The error that's displayed is: report error: User-Defined exception
    using Apex version 4.1.1. I've already tried building a new tabular form, but that didn't seem to resolve the issue.
    I would appreciate the help.
    Kind regards,
    Cleopatra

    Possible solution?
    Validation returns : no data found + unhandled user-defined exception
    See post by user 794496 there.

  • Custom Tabular Form with working days by quarter

    Hi All, I'm trying to create an application to improve an old excel that some people use in my office. I came across a challenge: create a page when a user can submit for each business day the amount of hours worked, the real problem is that I have to show on the same page 40 business days that need to be dynamic, I mean that there is a "period" table that has a start date and end date, the range between those two MINUS the Saturdays and Sundays should be the amount of COLUMNS that the report show.
    create table CT_PERIOD(
    PERIOD_ID VARCHAR2(6),
    PERIOD_FY VARCHAR2(4),
    PERIOD_QUARTER VARCHAR2(1),
    PERIOD_START_DATE DATE,
    PERIOD_END_DATE DATE,
    PERIOD_DAY_COUNT NUMBER,
    insert into ct_period values ('1', 'FY14', 'Q1', to_date('01-JUN-2013', 'DD-MON-YYYY'), to_date('25-AUG-2013', 'DD-MON-YYYY'), 56);
    commit;
    I searched in the web for some example of this with no luck, if somebody did something like this or knows where I can see an example that would be great!
    Thanks!

    Hi guys,
    I'm having exactly the same problem, I need a tabular form with days as columns to add actual working hours for each day as for each row ( task)

Maybe you are looking for

  • Can't delete Preferences in CS 4 (Design Standard)

         Haven't used Ilustrator in over a year (ill) and I can't add lettering to an historical photo design. Layers are locked, new layer started for lots of lettering to be added but I'm prevented from drawing the curved base lines I need to wrap the

  • What is the best virus protection for a Mac?

    What is the best virus protection for a Mac?

  • Hardware diagnostics

    I use my Mac Pro for music production. I run Pro Tools 10.2 with a Digi 003 interface. Ever since the 10.2 update my system keeps dropping the fire wire connection. I beleive it to be software but want to have my hardware checked out just to be on th

  • How to Create a Generic Compound Clip?

    Sometimes, when I create a Compound Clip, a generic "compound clip" is created - i.e. it is not given the option to be named, thus does not become an Event. Other times, seemingly doing the same thing, I am forced to give the new clip a name, which t

  • C202 idoc generation

    Hello All, I have a requirement like this. For transaction C202, (Master recipe change), when I go to Materials->BOM and change material quantity, and save the document, an idoc should be created. We hve Idoc type, Message type and Object type copied