ApexLib_TabForm

Hi,
I need to edit a row on a grid page, when the row is selected for that in a checkbox control, I use the next code
BEGIN
FOR ii IN 1 .. ApexLib_TabForm.getRowCount
LOOP
IF ApexLib_TabForm.hasRowChanged(ii, TRUE)
THEN
IF ApexLib_TabForm.isRowSelectorChecked(ii) THEN
UPDATE INVENTARIO SET ELIMINADO = 1 where ID = ApexLib_TabForm.V('ID', ii);
END IF;
END IF;
END LOOP;
END;
but when I run de aplication the code failed and tells me that I need to declarate the function ApexLib_TabForm.getRowCount
¿How can I declare the library ApexLib_TabForm in order to use it in my page?
thanks

Hi UserXY,
please check the documentation of ApexLib on [http://apexlib.oracleapex.info]
brgds,
Peter

Similar Messages

  • Patrick wolf's apexlib_tabform is misbehaving

    Hi Fellow APEX developers,
    I'm trying to implemented a 'logical delete' functionality in APEX 3.1, i.e. mark a record as deleted by updating a a database table column but not phyically delete it. I have a tabular form with default row selector which I am trying to interogate using the code below.
    The code below is copied and amended from Patrick Wolfe's web site. It belongs to a APEX On-submit- After Computations and Validations process and is called by a new manually created Delete button.
    The update statement is not being executed at all. The process is being executed when the button is pressed I've checked in Debug.
    I hope someone can shed some light on this.
    Thanks in advance.
    Regards,
    Austin
    -- Used to perform a 'Soft' or 'Logical' delete of a sales_contact record
    -- that is marked deletion.
    -- Do NOT physically DELETE a record that is marked for deletion.
    DECLARE
    v_sales_contact_id sales_contact.sales_contact_id%TYPE;
    BEGIN
    FOR v_index IN 1 .. ApexLib_TabForm.getRowCount LOOP
    IF ApexLib_TabForm.hasRowChanged(v_index) THEN
    IF apexlib_tabform.isrowselectorchecked(v_index) THEN
    v_sales_contact_id := APEXLIB_TABFORM.nv('SALES_CONTACT_ID'
    ,v_index);
    UPDATE sales_contact sc
    SET sc.termination_date = SYSDATE
    WHERE sc.operator_id = v_sales_contact_id;
    END IF;
    END IF;
    END LOOP;
    END;

    Hi All,
    From my investigations the arrays used in apexlib_tabform are not being initialised when I set a row for deletion using (the default row selector).
    I've also googled and searched the web for apexlib_tabform entries and found the following : http://www.inside-oracle-apex.com/2006/12/drop-in-replacement-for-v-and-nv.html
    I've followed the instructions on the url above and still no success..
    If anybody has encountered this issue please let me know how you resolved them.
    Regards,
    Austin

  • Error updating two reports on same page! Could you have a look please?

    Hey guys!
    I have the following situation :
    two updateable reports on one page with IDs 'DATE_REPORT' and 'WORK_REPORT'
    two pl/sql processes on submit after c.... named 'SUBMIT_DATE' and 'SUBMIT_WORK'
    two buttons named 'SAVE_DATE' and 'SAVE_WORK'
    Finally, the insert and update processes are conditioned to Request = Expression 1 where for the 'DATE_REPORT' it is set to 'SAVE_DATE' and for the 'WORK_REPORT' it is logically set to 'SAVE_WORK'. There are no extra button conditions.
    My problem: No matter which button I press, the array is build up from the columns of the first report and continues to add rows of the second report.
    For instance: 'DATE_REPORT' has 11 rows and 'WORK_REPORT' has 9 rows. In the debug mode I can see that the array is build up using the 'DATE_REPORT' although 'SAVE_WORK' was accepted as the request. The same problem vice versa for the other update.
    ......column CNT_ARBEIT_CRIT_DATE mapped to WWV_Flow.g_f02
    ......column LNG_ARBEITSSCHRITT mapped to WWV_Flow.g_f03
    ......column STR_ARBEITSSCHRITT not mapped - not stateful.
    ......column DATE_GP_X_START mapped to WWV_Flow.g_f04
    ......column DATE_GP_X_END mapped to WWV_Flow.g_f05
    ......column DATE_R_X_START mapped to WWV_Flow.g_f06
    ......column DATE_R_X_END mapped to WWV_Flow.g_f07
    ......column LNG_GEBIET mapped to WWV_Flow.g_f08
    ......column CS not mapped - not stateful.
    ...array has 20 row(s). Used f08 to count.
    Validate report columns(ApexLib_TabForm.validateColumns)
    Row 12 has checksum error. ORA-01403: no data found ORA-01403: no data found ORA-01403: no data found
    ...Row 12
    ...LNG_ARBEITSSCHRITT
    ...CNT_ARBEIT_CRIT_DATE
    ......is not required
    ...LNG_GEBIET
    ......is not required
    ...DATE_GP_X_START
    ......is not required
    ...DATE_GP_X_END
    ......is not required
    ...DATE_R_X_START
    ......is not required
    ...DATE_R_X_END
    0.00: A C C E P T: Request="SAVE_WORK"How can I make sure the arrays are made up from the reports that are subject to the update???
    Many thanks for reading this post and giving some help if you have an idea!
    Regards,
    Seb
    Edited by: skahlert on 13.03.2010 10:57

    Hi Peter! Thanks for your answer. Well, this is what I already assumed! Two updateable reports with different data sources on one page will not work taht easily.
    Both reports have different amounts of columns in my case! I might create some pseudocolumns in the first report to match the columns in the second one. Hence I could try to build up the array like that.
    However, I believe it will not work as I can't use the primary key for the insert procedure in my second report. This is due to the design of the report.
    My initial idea was to somehow deactivate my report regions before running the update resp. insert procedure.
    I thought of using the htp.p statement with 'hideShow(''DATE_REPORT'')' and 'hideShow(''WORK_REPORT'')' to deactivate the regions and run the dml processes afterwards. Of course hiding the regions depending on the requested dml process. My question is if it will actually work like that. My try to hide the regions failed. The DATE_REPORT was indeed hidden but the update was still unsuccessful. I believe hiding the region is not sufficient.
    Do you have a hint how I can completely disable or deactivate the reports using javascript from pl/sql?
    Many thanks and have a splendid sunday!
    Regards,
    Sebastian

  • Apexlib page item validation not shown correctly

    Good morning guys! I have a question concerning the Apexlib page item validations.
    Basically I just want to validate page item values and have errors displayed in a notification region on the very same page on submit.
    I set up the Apexlib, which works perfectly for reports. However, when it comes to the page item validations, I am always rerouted to the Oracle Error page.
    Do you know why or have you experienced similar problems?
    Here is a part of the debug code when the error page is initialized.
    Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: ...Process "ApplyMRU": MULTI_ROW_UPDATE (ON_SUBMIT_BEFORE_COMPUTATION) #OWNER#:VT_TBL_TOTHOLZ:CNT_TOTHOLZ
    0.04: Branch point: BEFORE_COMPUTATION
    0.04: Computation point: AFTER_SUBMIT
    0.04: Tabs: Perform Branching for Tab Requests
    0.04: Branch point: BEFORE_VALIDATION
    0.04: Perform validations:
    0.04: Branch point: BEFORE_PROCESSING
    0.04: Processing point: AFTER_SUBMIT
    0.04: ...Process "ApexLib-Before Computation/Validation": PLSQL (AFTER_SUBMIT) BEGIN ApexLib_Lov.clearLovNullValues; ApexLib_Item.validateItems; ApexLib_TabForm.validateColumns; -- ApexLib_Error.showErrorStack; END;
    0.06: Show ERROR page...
    If you have an idea please be so kind as to let me know!
    Many thanks,
    Seb

    Hi Peter!
    Thanks for having a look!
    I am using Apex 3.2 and Apexlib 1.6!
    Like I said, the report validations are functioning properly! It's just the error message is not displayed on the same page in a notification field. Instead the user is redirected to the original Apex Error Page when the error is caught.
    What validation do I want to carry out?
    I tried to verify the input of a text box with $APEXLIB_MAX_VALUE=10$.
    I thought it might be a minor problem, which I couldn't find. Already checked the installation of Apexlib twice. Seems to be alright.
    Best regards,
    Seb
    PS: Have a splendid WE

  • 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.

  • APEXLIB error in updateable tabular form

    We are using APEXLIB to validate / make updates using a tabular form and we are getting the following error.
    ORA-06550: line 2, column 27: PLS-00302: component 'APEXLIB_TABFORM' must be declared ORA-06550: line 2, column 4: PL/SQL: Statement ignored ORA-06550: line 93, column 16: PLS-00302: component 'APEXLIB_ERROR' must be declared ORA-06550: line 93, column 1: PL/SQL: Statement ignored
    ERR-1024 Unable to run "function body returning text" validation.
    Can anyone help with this error?

    I think you need to post this question to the owner of APEXLIB at http://apexlib.oracleapex.info/. APEXLIB is not written by Oracle.

  • Apexlib validation not functional

    Hello pros and Apex devs!
    I have an application where I integrated the Apexlib! I followed the official tutorial and check back and fourth.
    However, the item or column validation is not working!
    In debug mode I stumbled upon the following code, which suggests that the validation is not ignored but aborted.
    Generate item data(ApexLib_Item.generateBrowserData)
    ...done
    Read report column mapping(ApexLib_TabForm.init)
    ...processing MYREPORT
    ...ignore validation = NO
    ...*** Condition found! Abort and continue with next regionThe resizable text areas, a feature of Apexlib, are working. An indicator that Apexlib is partly functional in this app.
    Do you have an idea what needs to be done to get the column/item validation to work?
    $APEXLIB_REQUIRED$ is present in the link attribrutes for the columns to be checked. I have no more ideas!
    Any help is greatly appreciated!
    Thanks a lot for reading this post,
    Sebastian

    Hello Peter!
    Just wanted to coma back to you and tell you that the Apexlib is finally working to a certain extent.
    The only thing that bugs me is the fact that the validation is obviously not carried out before submitting the page. If a field that has an option attribute $APEXLIB_REQUIRED$ is left empty and I hit the submit button, the respective db constraint catches the error and display an ORA-20001 error.
    Actually I wanted to use Apexlib error validation to avoid the constraint violation directly at frontend level!
    regards,
    Sebastian

  • Very Urgent: Apexlib error ora-00900 invalid sql statement

    Hi,
    If i'm opening a page where there are LOV I get the strange error in the debug mode. Has it perhaps anything to do with grants?
    pls help asap if you can
    Read report column mapping(ApexLib_TabForm.init)
    ...processing Interface execution selection
    ...ignore validation = NO
    Get column list(ApexLib_Sql.getColumnList)
    ...parse query = 獥汥捴 䥎呅剆䅃䕟䑁呅Ⰺ䥎呅剆䅃䕟䑁呅⁉乔䕒䙁䍅彄䅔䕟䑉卐䱁夬ੈ佒䥚低彂䰬੆䕐彂䰊晲潭⁆䕐彉乔䕒䙁䍅彃䅌䕎䑁刊睨敲攠楮瑥牦慣敟摡瑥整睥敮慳瑟摡礨慤摟浯湴桳⡴潟摡瑥⠺倱㥟捡汥湤慲彤慴攬❙奙奍䵄䐧⤬ⴱ⤩⬱⁁乄⁌慳瑟摡礨瑯彤慴攨㩐ㄹ彣慬敮摡牟摡瑥Ⱗ奙奙䵍䑄✩⤊潲摥爠批‱਀
    ORA-00900: invalid SQL statement

    Hi Irvine74,
    for ApexLib problems it's better to use the related SourceForge support forum at http://sourceforge.net/forum/?group_id=184339 , because I'm not always monitoring the OTN forum.
    Are you only getting the error in debug mode?
    Is your report query on that page a valid SQL statement?
    If you comment out the PL/SQL code with /* */ (don't forget to add a NULL; statement at the end to have a valid region) on page 0 "ApexLib - Before footer", are you now getting an error from APEX that the statement isn't valid?
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Disabling a weblink within a report

    In accounts, I have a report(Dues) which reports on fields in CO1.
    There is a weblink to launch another report (Past Due Details), within the report 'Dues', which reports on fields in CO2.
    I wish to either:
    1. Disable the weblink within report 'Dues', if one of the fields(Total Past Due), within the same report contains the value '0.00'.
    or
    2. pass the value of 'Total Past Due' (when clicking on the weblink) so that it displays a blank report or a report with an error message.
    I hope someone can help me out with this 'roadblock'....
    Edited by: raverz on Dec 1, 2008 2:31 AM

    Hi Rod,
    just to make sure that I understood you correctly.
    You have a report with a row selector and NO default ApplyMRU process. Instead you have written a process (on submit - after comp and validation) with the code you posted, where you now try to insert into another table than the report is based on. Correct? If so, you where already close with your solution.
    BEGIN
        FOR i IN 1.. HTMLDB_APPLICATION.G_F01.COUNT LOOP
            INSERT INTO PL_ALB_IMGS VALUES (PL_ALB_IMGS_SEQ.nextval, HTMLDB_APPLICATION.G_F01(i), :P16_ALBUM_ID);
        END LOOP;
    END;You could also use my Plug & Play Tabular Form handling (http://inside-apex.blogspot.com/2006/12/plug-play-tabular-form-handling.html).
    In that case your code would look like that.
    BEGIN
        FOR i IN 1 .. ApexLib_TabForm.getRowCount
        LOOP
            INSERT INTO PL_ALB_IMGS VALUES (PL_ALB_IMGS_SEQ.nextval, ApexLib_TabForm.V('CHECK$01', i), :P16_ALBUM_ID);
        END LOOP;
    END;This library allows you to access columns by there name.
    Hope this helps
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com

  • MRU - trying to restrict UPDATE to only certain users - everyone INSERT

    Application Express 2.2.1.00.04
    I’m looking for a solution to a problem. I have a region that is a multi-row SQL Query (Updateable). Everything works as expected. Now, I’d like to restrict the ability to update ANY rows based upon an authorization scheme.
    I want everyone accessing my application to be able to insert rows (WORKS FINE).
    I only want certain authorized people to be able to update existing rows (CAN’T GET THIS TO WORK).
    Anyone have any ideas?
    Thanks, Mike

    Hi Mike,
    I think you have two possibilities:
    1) Create a page validation with some similar code:
    DECLARE
        vHasUpdatePriv BOOLEAN := apex_util.public_check_authorization('MY_AUTHORIZATION_SCHEME');
        vExists NUMBER;
    BEGIN
        FOR ii IN 1 .. Apex_Application.g_f01.COUNT
        LOOP
            IF [check if record has changed by comparing against MD5 checksum]
              AND Apex_Application.g_f01(ii) IS NOT NULL -- I assume f01 stores the PK
              AND NOT vHasUpdatePriv
            THEN
                RAISE_APPLICATION_ERROR(-20123, 'You try to update, but you don''t have update privileges!');
            END IF;
        END LOOP;
    END;Or if you don't want to care how to check if a record has changed, take a look at http://inside-apex.blogspot.com/2006/12/plug-play-tabular-form-handling.html
    With that library the code would look like:
    DECLARE
        vHasUpdatePriv BOOLEAN := apex_util.public_check_authorization('MY_AUTHORIZATION_SCHEME');
        vExists NUMBER;
    BEGIN
        FOR ii IN 1 .. ApexLib_TabForm.getRowCount
        LOOP
            IF    ApexLib_TabForm.hasRowChanged(ii)
              AND ApexLib_TabForm.NV('YOUR_PK_COLUMN') IS NOT NULL
              AND NOT vHasUpdatePriv
            THEN
                ApexLib_Error.raiseError
                  ( pError => 'You try to update, but you don''t have update privileges!'
            END IF;
        END LOOP;
    END;2) You could write your own MRU process, which does the same as above, but additionally you also have to check for lost-update-detection, ...
    Hope that gives you a direction
    Patrick

  • APEXLIB Installation

    I have installed the apex builder successfully
    and have tried to installed the apexlib framework and the apexlib example app but
    when i run any of the pages i get the following error on the bottom of them all
    i installed the framework into the application schema
    ORA-06550: line 4, column 1: PLS-00201: identifier 'APEXLIB_PAGE.GENERATEBROWSERDATA' must be declared ORA-06550: line 4, column 1: PL/SQL: Statement ignored ORA-06550: line 8, column 1: PLS-00201: identifier 'APEXLIB_ITEM.GENERATEBROWSERDATA' must be declared ORA-06550: line 8, column 1: PL/SQL: Statement ignored ORA-06550: line 9, column 1: PLS-00201: identifier 'APEXLIB_TABFORM.GENERATEBROWSERDATA' must be declared ORA-06550: line 9, column 1: PL/SQL: Statement ignored ORA-06550: line 14, column 1: PLS
    i have given all the users permissions on the package APEXLIB_TABFORM
    I really need to do the tabular form validation that apexlib provides
    i have search the forum high and low and no one seems able to provide a simple solution
    to tabular validation except install apexlib
    also when i look at the page definition i cannot actually seem to find where it does the validation ???
    Cheers....Chris

    Hi Arif,
    it's better to post ApexLib related questions into the related support forum at http://sourceforge.net/forum/forum.php?forum_id=643201 or write me an e-mail. Because I'm not always monitoring the OTN forum.
    Is it possible for you to create a testcase on apex.oracle.com which shows this problem. You can also modify the demonstration application.
    Do you use Firefox? Because most time it shows better error messages then IE.
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Issues with ApexLib after upgrading to Apex4

    After upgrading our application to Apex 4 we have run into some issues that look to be related to ApexLib. We had issues with popup LOV’s and some tabular forms, after upgrading to ApexLib 2.1.2 the popup LOV's seem to be resolved. But we still have some problems when trying to update a tabular form that uses ApexLib validation. When trying to update we get an error that 'field' is needed, but the 'field' has been selected from a select LOV.
    The error shows "Row 1: Health ED is required."
    The code is:
    select
    "PERSON_WP_HLTH_ID",
    "PERSON_WP_HLTH_ID" PERSON_WP_HLTH_ID_DISPLAY,
    "PERSON_ID",
    "PERSON_WP_HLTH_ED_CODE",
    "PERSON_WP_HLTH_OTHER"
    from "#OWNER#"."PERSON_WP_HLTH"
    where person_id = :p58_person_id
    I get this in debug mode.
    ...Process "ApexLib-Before Computation/Validation": PLSQL (ON_SUBMIT_BEFORE_COMPUTATION) BEGIN ApexLib_Item.setBoolDefault; ApexLib_Item.trimItems; ApexLib_TabForm.trimColumns; ApexLib_Lov.clearLovNullValues; ApexLib_Item.validateItems; ApexLib_TabForm.validateColumns; -- ApexLib_Error.showErrorStack; END;
    I'm not convinced this is ApexLib related, but not sure what else might be the issue. Any thoughts or comments welcome.
    Cheers,
    JB
    Edited by: Forward IT Thinking on Sep 10, 2010 12:01 AM

    Peter,
    I'm fairly new to APEX, would love to put a copy up on apex.oracle.com but not sure on the process. I have an account there, but don't have a packaged application yet so how to do that. If it's a simple process and you can point me to the process that would be appreciated.
    In the mean time, I would have no problem setting up a developer and user account account temporarily for you to take a look. You can email me at [email protected] and I'll get you the info.
    Thanks for you prompt response.
    Regards,
    John Bewley
    Edited by: Forward IT Thinking on Sep 10, 2010 4:02 PM

Maybe you are looking for