Posts

Showing posts with the label on demand

Building dynamic forms

How do I build a dynamic form? Well first, you need to have your questions stored somewhere, so we set up the following (basic) model: CREATE TABLE DYNAMIC_QS( ID NUMBER PRIMARY KEY, QUESTION_KEY VARCHAR2(20) NOT NULL, QUESTION_TYPE VARCHAR2(20) NOT NULL, QUESTION_SEQ NUMBER NOT NULL ); / CREATE TABLE DYNAMIC_ANS( ID NUMBER PRIMARY KEY, QUESTION_KEY VARCHAR2(20) NOT NULL, QUESTION_ANS VARCHAR2(4000) NOT NULL ); / create sequence dynamic_qs_seq; / create or replace trigger BI_DYNAMIC_ANS before insert on DYNAMIC_ANS for each row begin :NEW.ID := dynamic_qs_seq.nextval; end BI_DYNAMIC_ANS; / insert into DYNAMIC_QS values (1, 'NAME', 'TEXT', 10); insert into DYNAMIC_QS values (2, 'AGE', 'TEXT', 20); insert into DYNAMIC_QS values (3, 'ADDRESS', 'TEXTAREA', 30); / create or replace view v_dynamic_qs as select dynamic_qs.id , dynamic_qs.question_key , dynamic_qs.question_type , dynamic_ans.quest...

Getting around large exports with RTF report templates

Image
If you are on a slow connection like me, you may find how much of a pain it is deploying apps that house some BI publisher report templates. It only takes a few templates before your app export becomes 10MB+ in size. Perhaps in a future release, report templates will be treated in the same way as application images, in that you can add them as a script to supporting objects so that you don't need to export the templates each and every deployment. If you haven't seen, apex_util has a procedure to download report queries, so by using that procedure coupled with storing your files in your own maintained table, you can avoid the issue of massive application exports. First create a table to store the templates: create table rtf_template( code varchar2(25) PRIMARY KEY , layout BLOB); / Then, add your template file to the table. We will need two application items (or 1 will do if you identify the layout with exactly the same name as the query). So I've created: ...

APEX AJAX Basics

Introduction I'll start of by saying this post isn't about achieving any particular task via AJAX - there are plenty of examples out there already - but how to perform AJAX with Application Express. There seems to be no official documentation on the matter, so wanted to do a general overview on how to achieve AJAX techniques. Of course, it is also worth mentioning, writing your own AJAX functions is not so necessary anymore, with the addition of Dynamic Actions in APEX 4. Never the less, it is still worth knowing. The most common technique for AJAX in Application Express is to have PL/SQL code in an on demand process, and then calling that process via Javascript at run time. Application Express provides a helper function for calling an on demand process, and that is htmldb_Get (and additionally, apex.ajax.ondemand which is effectively a wrapper object for htmldb_Get object). With the release of APEX 4, came the jQuery library included - so another option for using AJAX is...