Multi Row Form and onload

Hi,
I've a wizard based Multi Row Form (MRF) based on a view (on 2 tables) with Instead of triggers to handle the DML. I have an onchange event on one particular Select List based item in each row that simply disables/enables other row items depending on the value. All this is working fine, but I need to repeat the disable/enable of items for each row once the page has loaded.
My initial thought is to use an onload event in the Page definition, but can and should I be handling this in a Page Process instead (bear in mind that this is a wizard generated MRF)? Also, I need to ensure that new rows (via the Add Row button) are handled correctly. If I go down the onload event route, then is the simplest way just to get an array (getElementsById?) of the items and loop through them? Any thoughts would be most appreciated on the most efficient way to do this.
Cheers,
PaulB

Hi,
Yes, it appears the same as an onload but, fortunately, doesn't interfere with any existing onload code - you can only have one onload function call for the window object.
You can loop through the items on the form using something like:
function disableItems()
var x = document.getElementsByName("f03");
var y = document.getElementsByName("f04");
for (int k = 0; k < x.length; k++)
if (x(k).value == 'A')
  y(k).disabled = true;
else
  y(k).disabled = false;
}This assumes that the select list is in column 3 (which should mean that the SELECT objects should have a name attribute of "f03") and that the item you want to disable/enable is in column 4 ("f04") - so adjust as necessary.
As you have the same number of items in column 3 and column 4 - the above loops through the ones in column 3, checks the value selected and then disables/enables the item in the same row in column 4.
Andy

Similar Messages

  • Updating Multi-Row Form Data

    Hi Folks,
    I have the following multi-row form:
    !http://img216.imageshack.us/img216/7250/screenexample.jpg!
    This is based on the following query:
    SELECT id,
           ticker,
           deal_date,
           deal_type,
           no_shares,
           price_per_share,
           commision,
           stamp_duty,
           APEX_ITEM.CHECKBOX( 1, NULL ) AS group_ind,
           trade_group_id
      FROM trades
    WHERE ticker = 'FXPO'
    ORDER BY trade_group_id,
              ticker,
              deal_dateWhen I tick the GROUP_IND Checkbox, I want only the TRADE_GROUP_ID column value to be updated in the database for the associated row. Obviously, I could tick the checkbox in multiple rows.
    My questions are:
    1. Is it possible to modify the ApplyMRU routine to do this?
    2. If not, how would I go about submitting the ID and TRADE_GROUP_ID columns to a stored proc via an array from the APEX front end?
    3. Is there a best practice solution for my reports.
    I have some layout questions aswell, but I'll post those on a separate thread once the main functionality is working.
    Cheers.
    James

    James,
    You have access to the checked IDs using the apex_application.g_f01 array. You can pass it to your pl/sql ie:
    procedure test(p_arr in vc_arr2)
    begin
    for in in 1..p_arr.count
    loop dbms_output.put_line(p_arr(i));
    end loop;
    end;
    now you can just call your procedure with a process test(apex_application.g_f01);

  • Multi-row form with button to save and add another row

    Can you have a button on a multi-row tabular form that would save the current changes, and than open a new row up on the fom for a new entry to be entered? This would combine the save and add a row button functions.

    Add Row button is doing exactly what you are asking for - it will save the chages you
    made and add a new row.
    Denes Kubicek

  • Multi-Row Form Validations - Cannot Re-Use Phone Nos from select LOV

    1) I need some help with a "Multi-Row" data-entry form (page 9)...I have a select list of phone-no's that user picks from the drop-down lov list on a page multi-row select list-drop down - P9_PHONE_ID (has built in lov). The data form is built on 'site_phone_assign' table.
    However, I need to put a page-level validation where the user CANNOT select a pre-assigned phone id (reuse a phone) that's already been assigned (used) and a record exists in the site_phone_assign table. I built the following page level validation on the multi-row edit form which is built on 'site_phone_assign' table...NOT WORKING!
    PLEASE HELP WITH THE BEST WAY TO DO THIS..Thanks!
    --validation type: Function returning boolean
    <code>
    DECLARE
    v_count pls_integer default 1;
    BEGIN
    IF (:P9_PHONE_ID IS NOT NULL) THEN
    select count(*)
    into v_count
    from datahub.site_phone_assign s
    where s.phone_id = :P9_PHONE_ID
    and s.ASSIGN_START_DATE <= SYSDATE
    AND NVL(s.ASSIGN_END_DATE,SYSDATE+1) >= SYSDATE;
    END IF;
    IF (v_count) > 0 THEN
    RETURN (FALSE);
    ELSE
    RETURN (TRUE);
    END IF;
    END;
    </code>
    2) How can I apply validations on a multi-row edit form page where say - start_date is always less than end_date? Both start/end dates are date-picker type of items.
    3) Can ITEM NOT NULL validation be applied on a multi-row edit page? I guess its page-level validation right? Please advice.
    Edited by: Shravanv on Feb 18, 2010 1:50 PM

    Hello,
    In a Tabular Form you need to loop through the records on the screen, so doing a check on :P9_PHONE_ID doesn't work...
    Patrick Wolf made a general solution for this problem, you can read about it here: http://www.inside-oracle-apex.com/plug-play-tabular-form-handling/
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.sumneva.com/

  • Multi Row Delete and then I get a unique contraint violation on my PK

    I have a simple table with 2 columns, one a PK. I have a checkbox style, multi-row delete function setup on this (to be honest, APEX set this up automatically).
    I removed the add/edit functionality to keep just the delete button and delete procedure.
    When I select an item, and then click delete, I get a unique constraint violation that I'm violating my Primary Key.
    How can I fix this, or see what it's doing when it tries to delete the row?

    Hi,
    It sounds as though you haven't properly removed all of the add/edit functionality or that you still have some form of validation and/or computation in place or that you have a trigger that is trying to insert records into, for example, a history table (is the constraint on the table you are deleting from - the error message should tell you this?)
    Check that the only process you have is ApplyMRD and that this is pointing to the correct table and has the correct primary key set. Ensure that this has Conditional Processing set for a Request of "MULTI_ROW_DELETE".
    Check for any validations - there is no need to perform validations if your user can not insert or update data unless you want to check that they've ticked one or more checkboxes.
    Check for processes that could run if the user clicks the Delete button. Validations and processes could be conditional on either the button click or on request = "MULTI_ROW_DELETE".
    Review any triggers that you have on the table to ensure that deletions do not try to insert records into another table where the primary key on that table is not being populated.
    Regards
    Andy

  • JSP Multi Row Edits and Struts Validator

    Hello,
    I followed this howto: http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html and implemented multi row editing. Now I'd like to use Struts Validator for validating data in multiple rows. Is there any howto document on this subject?
    Thanks,
    Anna

    I think I will have to look inside the JHeadStart source code that extends DataAction, understand how that code works, and finally get the pieces I'm interested in...

  • JDAPI with multi canvas form and LAF questions

    I'm trying to use jdapi to apply LAF project on my forms, it works great with simple forms, but with multi canvases and blocks form it doesn't apply LAF for all of them. I can follow the code of the done one for the rest, but i have questions:
    do i have to set a different bean for each block?
    who overrides, the bean or the property set for the item?
    and sorry i have another questions concerning LAF:
    can i define a new scheme, and if yes, how?
    if i want to show an image for a button, the path should be relative to what? as till now i failed to set an image for a button.
    Thanks

    Hello,
    I have just tested and the result is OK.
    I have built a Forms module with 2 content canvases, each one containing a block.
    After running the JDAPI_LAF tool, the new module contains a LAF_BLOCK with two Bean area, each one one a different canvas.
    <p>Concerning the image on the button, the syntax is explained in the documentation</p>
    See the SET_IMAGE method.
    Francois

  • Multi-row "Drag and Drop" works for some users, not others

          Background: We are working on Win7 SP1 clients, Project Prof. 2010, SP2
          A couple of users have reported that they cannot move ("drag") multiple selected rows in a task sheet, only a single row at a time. Other MS Project users around them (and myself) can move multiple rows with the "Drag"
    feature. "Drag and Drop" is selected in the "Options/Advanced" section of both their local global template and the Enterprise Global.
         To my knowledge, the multiple row selections contain no collapsed summary tasks, in case that might be an issue.
         I'm suspecting some Windows setting is amiss on the offending clients, but wanted to see if anyone else had seen this behavior before in Project Prof. 2010.
         Thanks!
    JTC
    JAckson T. Cole, PMP, MCITP

        Thanks for the response, Shiva!
        User community is on MS Project 2010 (14.0.7011.1000) SP2, MSO (14.0.7128.1000)
        To reproduce the problem, MS Project user will select multiple task rows by selecting first row, then holding MB1, and "sliding" to the last row desired. The problem manifests itself by NOT turning the cursor into the "four-arrow cross"
    after selection is accomplished. If only one row is selected, the ability to move that row alone is available.
         Again, only a couple of users (that have called me!) are seeing it. Their officemates are not having an issue.
         FYI ...
    JTC
    JAckson T. Cole, PMP, MCITP

  • How to populate a multi row form in Apex

    Hi
    I have a form in Application Express built using "Tabular Form" option while creating the page. The table being filled by the form is as follows
    Cell_ID(varchar) reading_date(date) Value1(num) Value2(num) Location(varchar2)
    Now I need to do the following
    1. I want the page to display 200 rows for data entry on page load itself instead of user clicking Add Row button 200 times. ( For every location 200 entries need to be made for 200 diff Cell_IDs at the same date )
    2. I want each row to take value for the Date column from the single date picker item displayed on top of page instead of entering the same date 200 times by user.
    3. The cell_IDs are automatically populated with values loc1_001 loc1_002 .......... loc1_200 on selection of Location from another Item (select list) placed on top of the page.
    Please Help anyone. Looking forward to a response.
    Regards
    Saurabh

    <h3>Please help any one guys.</h3>

  • Custom Popup on a Tabular Form for Multi Row Operation

    I am trying to implement a custom popup on a tabular form that I can pass a value typed in to a text item like “Name” to the popup so it can filter a list of names on what was already typed in.
    Once a selection is made I need to have the selected name passed back to the text item.
    This is easily done when not using a Tabular Form. Any ideas would be great?

    Can someone please help me with this?
    I've read the Thread:
    "Custom Popup on a Tabular Form for Multi Row Operation",
    and have tried following the instructions provided by Willi Firulais.
    I've also tried to integrate the instructions provided by RWeide in response within the same Thread.
    I cannot get the passBack function to Pass the value to the Calling Page.
    (I've tried to organize the pertinent information as it pertains to my application,
    and have included it here below:)
    A. Calling Page (Page# 141)
    1. HTML Header: (Page# 141)
    <script> function callMyPopup(item) { var url;
    url = 'f?p=&APP_ID.:143:&APP_SESSION.::::P143_ITEM:'+ item;
    w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
    if (w.opener == null) w.opener = self; w.focus(); }
    </script>
    2. Region Definition: (Orders) - SQL Query (Updateable Report)
    a. Query:
    select
    'f01_'||to_char(rownum ,'FM0999') ITEM,
    "ID",
    "ID" ID_DISPLAY,
    "ID_PROJECT",
    "ID_SUPPLIER",
    "DESCRIPTION",
    "JOB_NO",
    "QUANTITY",
    "UNIT_PRICE",
    "EXTENDED_PRICE",
    "MANUFACTURER",
    "SUPPLIER",
    "PART_NO",
    "GROUP_LIST",
    "BILLED_PRICE",
    "DATE_NEEDED",
    "DATE_DELIVERED",
    "SUPPLIER_TYPE",
    rownum
    from "#OWNER#"."OAX_MAT_ORDER_ITEMS07"
    where job_no = :P141_JOB_NO
    3. Report Attributes: (ITEM) - URL
    javascript:callMyPopup('#ITEM#');
    B. PopUp Page (Page# 143)
    1. HTML Header: (Page# 143)
    <script language="JavaScript"> function passBack(passItem1, passVal1)
    { opener.document.forms["wwv_flow"].SUPPLIER[&P143_ITEM.].value = passVal1;
    close(); }
    </script>
    2. ITEMS:
    P143_ITEM
    3. Region Definition: (Suppliers) - SQL Query(Structured Query)
    OAX_SUPPLIERS.ID
    OAX_SUPPLIERS.NAME
    4. Report Attributes: (NAME) - URL
    javascript:passBack('&P143_ITEM.','#NAME#');
    Thank you in advance for you help!

  • Multiple Users - Tabular Forms - Multi Row Update.....

    Greetings All,
    Any comments, assistance, links, or even answers on the following situation would be much appreciated....
    I have a Application Express 4.0 (Could upgrade to 4.1 if it would help this issue)
    I have a wizard generated tabular form on a table, the form will show up to 600 records (rows) on a page.
    Part 1:
    The situation:
    User 1: Opens the form and brings up latest data set.
    User 2: Opens the form and brings up the latest data set.
    User 1: Changes data for record 1
    User 1: Hits submit. The data is saved.
    User 2: Changes data for record 1
    User 2: Changes data for record 2
    User 2: Hits submit. The following error is produced:
    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 = "3EE15D666E9DBDC59D34CE4CFB3950C0", item checksum = "922DA12AE1E3D8856695745C4D2830D2"., update "<Removed> Error Unable to process update.
    When this error occurs no updates get made to the table.
    I understand that row 1 can not be updated, however I would like row 2 (and all other rows where there is no conflict) to be updated. I would then like to be able to highlight in the form the rows that failed to update (And reload the data in them from the DB).
    Is this something I can achieve using my own MRU procedure, or in another way?
    Can anyone point me to a good example, tutorial or book showing how to do this.
    Thanks!

    Thanks for the comments guys.
    I have solved my issue in two different ways. Way one was not so clever, but worked, involving writing my own process for handling multi-row updates and would allow a user to fill in data for multiple rows (say 10) and have only the row with changed data rejected. V2 takes a very different approach, it uses Javascript, AJAX and the DOM model of the form to check when data is changed / updated by the user. Essentially, when a user enters an updateable form element, a AJAX request checks if the data has been changed. If it has, the value in the form is updated, and the color changed to blue to alert the user. When the user updates the data item, and AJAX request posts the new value to the database, where it is inserted. I had to build a bit of a framework to make this useable, and have to use dynamic sql in the database packages, but it work really well for what my users need! There are limitations (Currently it only supports date fields, text fields and drop down lists) but it works for me. It also involves traffic back and forth with the server each time a user moves the focus to a new form element, but it is a very light request and the work to do the select / updates in oracle is all based on a primary ke, so is ver quick.
    Solution 1: (Would need to be made much more elegant):
    1: Create a new text Item called P5_MESSAGE (To display error / success messages)
    2: Create a new process:
    DECLARE
    l_cks wwv_flow_global.vc_arr2;
    j pls_integer := 1;
    vUpdatedCount number := 0;
    vErrorCount number:=0;
    vMessage varchar2(4000):='';
    BEGIN
    select wwv_flow_item.md5(firstname,lastname,age) cks
    BULK COLLECT INTO
    l_cks
    from VA_TEST1 ;
    for i in 1..l_cks.count
    loop
    if htmldb_application.g_fcs(i) != l_cks(i) then
    -- Log error
    vErrorCount:=vErrorCount+1;
    vMessage:=vMessage||'Could not update row with ID:' || htmldb_application.g_f01(i) || '. This data has been updated by another user since you retrieved the data.<br>';
    else
    -- Do insert
    vUpdatedCount:=vUpdatedCount+1;
    update VA_TEST1
    set
    FIRSTNAME = replace(htmldb_application.g_f02(i),'%'||'null%',NULL)
    ,LASTNAME = replace(htmldb_application.g_f03(i),'%'||'null%',NULL)
    ,AGE = replace(htmldb_application.g_f04(i),'%'||'null%',NULL)
    where ID = htmldb_application.g_f01(i);
    end if;
    end loop;
    :P5_MESSAGE := vMessage;
    end;
    Note, this currently updates every row, even if the data is unchanged, this could be fixed by comparing the checksum of the data to be inserted with the checksum of the data in the table, if the same then no need to insert.
    Solution 2:
    Too complex to explain in detail here, if you need to implement this then let me know.

  • Multi row tabular form

    can someone repost the instructions for tricking the master
    detail form into emulation a single table multi row form. I
    found someone who poited to an old posting that is no longer
    available

    repost

  • Inserting new rows in a JSP multi-row page

    Hi all.
    I´ve been implementing a JSP multi-row editable page according to the paper:
    http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html
    I noted that the code provided in the example just considers handling updates from the multi-row page, by comparing the existing rows in the ControlBinding rangeSet with the ones that came from the page.
    However, I need the ability to handle new rows from the same multi-row form that came from the page. So how can I achieve this task? What code should I include in the processUpdateModel method to handle new inputs?
    regards.
    Denis

    I think I will have to look inside the JHeadStart source code that extends DataAction, understand how that code works, and finally get the pieces I'm interested in...

  • Need to perform multi-row update/delete

    Gday,
    I have a request to have one update button for a multi-row form. Also needed will be a checkbox as part of the row.
    The check boxes only purpose is to signify the record should be deleted. Thus I am assuming I cannot use default
    apex functionality and must manually build the multi-row form. I guess I would loop through and check to see if a
    record is checked delete otherwise loop through and update all columns for that record? I am assuming I should
    use the examples in http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html
    is that all still valid for apex 3.2.1?
    Cheers

    Hello:
    You could also do the following
    Generate the tabular form page using the wizard
    Delete or not display the 'Delete' button
    Delete or not execute the 'ApplyMRD' process
    Create a new page process with a sequence higher than the standard MRU processes. Make this process conditional on the 'Submit' button. Use code similar to the one below for this page processfor i in 1..apex_application.g_f01.count loop   --- f01 is the selector checbox, f02 is the hidden column with the table's PK
      delete from emp where empno=apex_application.g_f02(apex_application.g_f01(i));
    end loop;Now, when you click 'Submit' records with their selector checkbox checked will be deleted by the newly added page process. The rest of the functionality of the tabular form remains the same.
    varad

  • Multi Row Insert

    I have read a few posts that mention a multi-row-insert but I can't find it.
    There is a multi row update and a multi row delete.
    I am using html db 1.6. We will be upgrading after we get this version of our app up and running, but don't want to take time out for the upgrade right now.
    Is multi_row_insert new to Application Express 2.0?
    Thanks,
    Gregory

    No, the multi row insert is not new to 2.0
    The builtin MRU processes handle multi-row updates and multi-row inserts. However, the default Add Rows process that the wizard creates on a tabular form does create only 1 blank row when you click the Add Row button. To increase this, just open the Add Rows process page and change 1 to a different number.

Maybe you are looking for

  • Having trouble setting up my website. It's probably a silly mistake.

    So I've registered a domain and hosting plan with A Simple Orange which had a pretty good deal since I had a coupon for 20% off. I've tried using Joomla to manage my website, but I couldn't get the hang of it. So I'm trying out iWeb 09' now and just

  • Class heirarchy question

    This beginning of this post sounds similar to another of my recent posts. The end question is different. I'm just providing the atmosphere for the situation I am coming from a c++ world into objective-c++/cocoa. I work for a company that sells static

  • How to find out version of Jakarta-ORO in Weblogic.jar

    Our environment is Weblogic 6.1 SP3 on Win2k professional with JDK 1.3.1_03 (build 1.3.1_03-b03). We use Protomatter Syslog in our application and it uses Jakarta ORO classes for regexp parsing. Since Weblogic jar already has the classes we do not ha

  • Exta fields to a std report copied to a Z

    Dear Experts, I have copied the std program RS_SOLAR_EVAL_DOCU into a Z report. The output is a ALV tree. My requiremetn is to adda additonal 5 fields to this ALV tree output. Please throw some light on this. I can either copy the classes in it, func

  • Help me, How can override a function of intelface?

    I want to overide a function of a interface . for example: There is a kFrameListBoss; it has Aggregated IObserver interface. Ioveserver interface has eight function: now ,I want to overide a function of IObserver,and overide only one function, the ot