Posts

Showing posts with the label submit

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

Triggering dynamic actions from a dialog button

A typical usage scenario is you create a region, give it a static ID, and set the default display to be hidden - the latter is handled if you select your region template as modal region. A typical JavaScript dynamic action to display the dialog, would be: $('#dialog-region').dialog({ width: 500, title: 'My Dialog', buttons: [ { text: 'Submit', click: function() { $(this).dialog("close"); } }, { text: 'Cancel', click: function() { $(this).dialog("close"); } } ] }) So the question is, how do we get some other dynamic action to fire when the button is clicked? Option 1 On the button, give it an id property, such as: { text: 'Submit', id: 'btn-submitDialog' click: function() { $(this).dialog("close"); } } And then, on your dynami...

Redirect to tab from LOV

Image
For this basic example, let me use it to re-direct to one of my tabs in my example application. I have Plugins, Google, Comments. Their submit values are T_PLUGINS, T_GOOGLE, T_COMMENTS respectively. Of course, this example was designed with the fact of apex set up with the tabs infrastructure and not lists - and to get to a specific tab, you submit the page with the tab name. Normally, I would use a LOV from an SQL query, however for this basic example, let me just create a static LOV query. Create the LOV in the shared components - you can find out more information about this in the builders guide - see:  http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/bldapp_lov.htm#HTMDB25450 Specify name as PAGE_TABS and type as Static. From here we want to set the display value as something that the user will see, and the return value as something we can use to. Se specify the display value as the tab display value, and the return value as the tab name. Once done...