ApexLib Framework – How to Integrate

I thought it’s time to put all the steps which are required to integrate the ApexLib Framework from the different postings into one integrated instruction. Makes it much easier when you use the framework for the first time.

Read the newest version of the How To Install document on the project homepage.

Note: The above version shows the most current version of the document which may already contain steps for features which have not been released yet. When you integrate the Framework into your application, always use the version of the document which is provided in the zip-file!

26 thoughts on “ApexLib Framework – How to Integrate

  1. Hi!
    Attempting to create the Regions on Page 0 to contain the Javascript Libraries causes an error in Apex (version 2.2):
    Expecting p_company or wwv_flow_company cookie to contain security group id of application owner.
    Error ERR-7621 Could not determine workspace for application (:) on application accept.

    Is this because of the size of the Paste operation?

  2. Hi Niall,

    don’t think that this message is related to ApexLib or the size of paste operation.

    Try to logout, close the browser and login again. Maybe try to create the region with a short text first – just to try and update it with the real text later.

    Hope that helps
    Patrick
    PS: You can also send me an e-mail (see Profile), makes it easier and faster to communicate.

  3. First may I say, you’ve done some great stuff here, and it’s going to save me a lot of time. One thing that I have noticed is that when I integrate the Framework into my application, I have trouble getting my onload processes to run. Any suggestions on why this may be happening?

    Thanks,
    Scott

  4. Hi Scott,

    great that you like it!

    I think your problem is the “fault” of the jQuery framework which I use. The docu says something that onload shouldn’t be used. I noticed that the onload attribute works, but if onload is set in JavaScript, it doesn’t work because it looks like the jQuery just reads the onload event when the library is initialized.

    Are you dynamically setting the onload event in a JavaScript or are you using the body attribute?

    Try using

    jQuery(document).ready(function(){alert(“test”);});

    or

    jQuery(document).ready(your_function);

    instead. The advantage of the ready method of jQuery is that it fires as soon as the DOM is finished, but doesn’t wait till all images are loaded as the onload event does.

    See jQuery – Events documentation for details.

    If you have further questions, send me a mail.

    Patrick

  5. Hi,

    I am very interested on trying iy. However, I cannot access the How to Integrate Link. I do not know why.

    Can I get that by email? Thanks a lot!

  6. Hi,

    When inspecting with Firebug,
    I get the folowing errors :

    apexlib is not defined
    [Break on this error] apexlib.error.init
    f (line 300)
    apexlib is not defined
    [Break on this error] apexlib.validation.addIgnoreRequest(“GET_NEXT_ID”);

    A beginner struggeling apex

  7. Hi Jules,

    the best would be if you would send me an e-mail which contains the HTML output of your page. Than I’m able to take a look at your problem.

    You can find the e-mail address in my profile.

    Patrick

  8. Hi Patrick,

    Thanks a lot for the tips you gave me!!
    It was my path that was not set correctly :
    He sould be :
    script src=”http://servernam:port/i/javascript/apexlib/jquery_Compressed.js” type=”text/javascript”>script

    and it was
    script src=”http://servernam:port/i/apexlib/jquery_Compressed.js” type=”text/javascript”>script

    Thanks a lot for the good help

    It is working now for the Generic solution for cascading select lists/lovs

    I hope the rest will work to.

    Thanks A LOT !!

  9. Hi Patrick…this is exactly what I have been looking for. thanks.

    I typed everything into page 0 and followed your instructions. I am now noticing that my cache seems to always clear values…is that a byproduct?

    Basically, I have a search field that is populated and a button is pressed. That had always worked, now it does not…it’s as if the search value has been cleared even before the query is executed.
    thanks

  10. Hi,

    can you write me an e-mail? This way it’s easier to communicate to track down your problem. You can find the e-mail in the HowToInstall.html

    Thanks
    Patrick

  11. Hi Patrick,

    Is there a way to make the ApexLib a bit more ‘generic’, so things like FLOWS_020200 aren’t hard-coded?

    I installed a previous version about 2 weeks before 3.0 came out, and then just upgraded to 3.0 last week, and I was chasing down all kinds of strange behaviours ever since.

    Today when I dropped the previous version’s schema, my app started generating error messages about one of my functions being in an invalid state, and tracking that down I discovered that it said the v() function was in an invalid state as well. So after a bit of searching, I found the v() function in my schema (I was originally looking in the FLOWS_xxxx schema), and changed the schema name to FLOWS_030000 and things appear to be working now, at least the error messages have gone away.

    Thanks,
    Bill Ferguson

  12. Hi Bill,

    I have already written an answer in the related OTN thread.

    The problem is that because the V/NV replacements (which are an add-on to the ApexLib Framework) have to use the schema names of the FLOWS_XXX schema, because they have the same name and otherwise it would be a recursive call to itself.

    But I’m up to suggestions, maybe someone else knows a solution for that.

    In ApexLib 1.5 I have mentioned this issue when you are going to upgrade to APEX 3.0

    Patrick

  13. Hi Patrick,

    To make it a bit more generic, there’s the possibility of tit the archaic way, and asking the user what version they’re using, and then in the install, execute the sql for whichever version.

    Or, though it would be a pain, have a little loop in the install routine that checks for the:

    max(substr(schema_name,6))
    where schema_name like ‘FLOWS_%

    (Not sure of the exact syntax, but it ‘seems’ like that might work as well).

    Just a couple thoughts, not sure if they’d work or not though.

    Bill Ferguson

    P.S. I’m hoping to get enough time in the next week or two to start experimenting with ApexLib. I really want to try out the diagrammer and the hacking the error message stuff.

  14. Hi,

    This is really a good piece of work. I tried it and it worked for me.

    M using Oracle 10gXE and it works fine.

    Thanks & all the best.
    Keep up the Good Work
    Vineet

  15. Hi,
    have you tried to use the “Static File” components in APEX to store the .js files? Reason for asking is that if you are hosting the application you usually don’t get the filesystem acccess needed to put them in the right place.

    Also, I assume that the scripts work in APEX 3.0.x.x.x.x

    Andy

  16. Hi Andy,

    the framework works with 3.0.x

    About static files, yes you can use the Share Components\Static Files or you can also paste the code of the file into the region as described in the How To Integrate. That’s probably faster because it doesn’t have to do the additional roundtrip.

    Patrick

  17. I have a multi row update form on my application page. I have page level validations on it to validate the required fields and allowed data length.

    I was facing the problem that when user didn’t fill a required field, error message was displayed in notification area, but all the data was reset to the previous state.

    To avoid this I am using ApexLib. I followed the instructions in example soultion “Display validation errors without page re-rendering” at:

    http://inside-apex.blogspot.com/2007/01/apexlib-new-release-v016.html

    Following the instructions I have created a page level validation as a last validation sequence wise, with error displaying inline and notification option and validation expression 1:

    ApexLib_Error.addApexValidationErrors;

    My other validations are still there.

    But instead of displaying inline, the error now displays on Error Page. However, a good sign is that the form reserves the state and doesn’t reset all the data entered when pressed OK on the error page.

    Please tell me what I’ll have to do to show error inline?

  18. I’ve noticed a small bug in the themes for Apex 3.0. In following your instructions to integrate Apexlib you mention setting txMessages and txNotification to your theme number in your Handle Error Page region on Page 0. What I’ve found is that for my Theme 6, the correct names are t6messages and t6notification in all lower case. When I later changed to Theme 12 I had to switch back to mixed case as you described.

  19. Hi Patrick,

    i have a problem in my application. I have created a page with a tabular form. The items in the tabular form have as type the SELECT LISTS. In the query of the list i have to use a data entered in a previous item. when i reference to the item in the same row i always get a null value. What is the syntax to reference the item in the same row.

    exemple: select group_name,id

    from flows_030000.wwv_flow_fnd_user_groups ug, flows_030000.wwv_flow_fnd_group_users gu

    where gu.group_id = ug.id

    and gu.user_id = :P_user_id — :P_user_id is the value entered in the tabular item in the same row.

    Thank you for your help.

    Rita Tabet

    Unilog Liban.

  20. Hi,

    I think you are looking for something like described here.

    BTW, you should remove the flows_030000 from your SQL statement, because that will cause problems when you upgrade to a new version and it isn’t necessary.

    Patrick

  21. patrick , i have managed to install the apexlib framework, apex builder plug in and have the example tabular form working

    just one question !!

    where is the code that does the validation !!

    cheers … chris bell

  22. For Browser Validation or for the Server Side checks? For Tabular Form or for Page Items? :-)

    The best would be if you write me an e-mail.

    Patrick

  23. Hallo Patrick,

    Punkt 5 auf “HowToIntegrate.html” ist ein wenig unklar wo und wie die “Applications Items” erstellt werden sollen.

    Tip? Screenshot?

    Vielen Dank im voraus.

    Viele Grüße
    Cliff

  24. Hallo Patrick,

    mein Kommentar eins oben drüber hat sich erledigt. Kann gelöscht werden.

    Gruß
    Cliff

Comments are closed.