Tuesday 24 January 2012

Positioning more than one region as child to parent region in apex




As many of them havte observed that in Oracle APEX we place loads of issues when it comes to positionsing the child region or item in the region.

Recently , i had encountered an requirement where i need to position the many regions as child for a parent region .

I looked into apex 3.0 , we didnt have parent region assignment option itself .

I looked into apex 4.0 , we had it , good enough .

But then again though i was especifying a region to be dispalyed in second col it was disaplying in the not being effected in position , and even there was huge problem with loook and feel.


 I thought y not use Oracle Apex javascript api , and i found very gud function called $dom_MakeParent.

Wanna see demo click here

Steps :-

Step 1):- Create one html region on the page , name it as parent region .
          Edit its source as

       <table>
<tr> <td id="cel1"> </td> <td id="cel2"> </td> </tr>
<tr> <td id="cel3"> </td> <td id="cel4"> </td> </tr>
      </table>


step 2) create multiple html regions change their static ids as child1id, child2id,child3id,child4id correspondingly.

step 3) edit page include this code on HTML header region of the page .

function assignparent()
{
alert('called');
// $dom_MakeParent(p_Node,p_Parent)
$dom_MakeParent('childid','cel1');
$dom_MakeParent('child2id','cel2');
$dom_MakeParent('child3id','cel3');
$dom_MakeParent('child4id','cel4');
alert('done');
}


Step 4) create a button name :- make child , url redirect : javascript:assignparent.

step 5) create another html region and set its parent as parent region which u have created and position 6



Now run the page , u can see last html region is already a child , now click make parent button and see the difference.

see Demo here

Making many regions as child region in Oracle apex dynamically

Exploring Oracle apex 4.1

Lets have look @ what we have in Oracle apex 4.1 .............

wokay lets gooo :)


The first change is Oracle apex Help link ... :(

1) It no more points to the PDF developer guide on our local instance ...it takes us to apex.oracle.com guide :(  , now incase i m working offline then i cannot access the Help link :(  ( Huh)

2) The Sample application link had more no of smaple applications with  examples sqon collections , database application and websheet application even :D

3) The learn more link of Oracle APEX points to the link , which opens another application , which is a websheet apex application , hence giving us gud idea how best we can use our websheet applications .

4) Web sheet application were simply a static pages with no dynamic data , but i found that 4.1 allows us to integrate the sql queries in the websheet . Along with this it even has come up with concept of data grid ... ( i remebred i encountered this term when i was doing by 12th and was working on Visual basic , data grid is nothing but a drag and drop tool , where we can enter certain data in form of excel and then perform basic db operations , i guess it will create the  respective table :D... though i didnot cross check as there was no developer edit option in Websheet :( huh.

 The demonstration section of the learning area is quite interesting and gives us amazing confidence of what all is possible in apex , i remebered in one my assignments i was struggling with the
" Hierarchy example" and here oracle apex 4.1 comes with the solution itself :D grt to know that :D .

XML example is very very interesting ... it teaches you how to play with XML data :D.
Dashboard region is an excellent Example of the Dynamic content .


Seriously i m dam excited to dirty my hands on this examples :D .. you will even love it for sure ;)


Again Forms examply thats Data entry in the tutorial list , it just gave a simple example to come out with the old look n fell of form and give a very refreshing look of jquery .

Go thru even Oracle maps and other example even .


5)  In a case , you have to upgarde you application suppose changing names of the items and lablels and all ... then now its made easier , who donot have to navigate each time to different pages to look for item .

You have something called utilities @ apex 4.1 @ application level even , in the right side you can see page utitlites , region utilties , item utilties , you can see all corresponding objects and change them here , rather than struggling and navigating to diff pages. You can edit all othem labels , help text and subsriptions in one go :)



6)My fav one is Methods on Tables Utility

Home >  SQL workshop > Utility > Methods on tables.

This uitilty will create an API for you on a table .
U need to input table name and it will create package containing all possible dml operations  on tables with  select_operation ( called get_tablename ) procedure .

The most best part was it was using md5 checksum function which most of the developers donot use to update the database .  This will avoid data integirty .


-- build MD5 function for table "AGENDA"
   function "BUILD_AGENDA_MD5" (
      "P_AGENDA_ID" in number,
      "P_MEETING_ID"  in number,
      "P_SELECT_AREA" in varchar2  default null,
      "P_AGENDA_ITEM" in varchar2  default null,
      "P_DATE_TODAY"  in date      default null,
      "P_COL_SEP"     in varchar2  default '|'
   ) return varchar2 is
 
   begin
 
      return utl_raw.cast_to_raw(dbms_obfuscation_toolkit.md5(input_string=>
         "P_MEETING_ID"  ||"P_COL_SEP"||
         "P_SELECT_AREA" ||"P_COL_SEP"||
         "P_AGENDA_ITEM" ||"P_COL_SEP"||
         "P_DATE_TODAY"  ||"P_COL_SEP"||
         ''
      ));

Oops Mobile Template in Oracle APEX 4.1 ???

Here goes my post for something interesting , i must say in which i  was always interested thats Oracle apex 4.1 with mobile themes.

I was customizing my themes to check what all other various options available.

I happened to encountered a word called Mobile ... i refreshed the page ... to see is it illusion ... I saw it again , it was Mobile  in the tab