Saturday, November 17, 2007

Passing Session Variables in a URL

When attempting to reference another page in your application with a URL link, it is important to know how to use APEX formatting. Here is an example:

http://apex.oracle.com/pls/apex/f?p=4350:1:220883407765693447

We will look at this starting with the pls and apex words. Basically, these two terms reference the apex application server, and are fairly common syntax for links.

f?p=4350:1:220883407765693447

The number 4350 represents the application id number, the number 1 represents the page number that will be referenced. The long number at the end of the link is the session id number. So, overall, a link will follow the following format:

http://apex.oracle.com/pls/apex/f?p=App:Page:Session

Other terms can be added in on the end, but I will not go into those at this point in time.

Now, if you want to develop dynamic links, the issue of setting the application,session id becomes an issue. Here is a little syntax to deal with that:

APP_SESSION.

Enter this term in place of the session ID number to take care of the dynamic data situation. The period at the end of the term is important, the link will not work without it.

If you want to make the application number dynamic, use the terminology:

APP_ID.

Again, the period needs to be at the end of the statement. So, overall, to make a totally dynamic url request, the following would be the pattern:

http://www.apex.com/pls/apex/f?p=&APP_ID.:1:&APP_SESSION.

&APP_ID will be the dynamic application id, &app_session will be the dynamic session variable.
Here is a helpful link.


Hope this helps.

Cheers
Jason

Friday, November 2, 2007

Link Javascript to Calendar Date

Greetings Yall......

Well, of course the head honcho at work desires a pop-up box when he clicks on a calendar date. This took a little figuering yesterday.....but I can say that I finally figured this one out after putting together a few different blog and forum postings.

First off, to link anything to a date in a calendar, insert the link into the calendar day link field on the Calendar Attributes page of the Region Definition section. What to insert in that section....well if you just want to link to another page in the application, it is pretty straight forward.....
1. Select "Page in this application"
2. Select the page number
3. Set the variables, if any, that you want to set from this page, into the next page.
4. Click Apply Settings.

However, should you have a handy javascript that you want to use, your link procedures will change. In this case do the following within the Day Link Field of the Calendar Attributes Page:
1. Select "URL" to link to
2. You will see all of the text fields go gray except the URL field at the bottom.
3. In this field, just type in the javascript call...for example.....javascript:callMyPopup()....without any other formatting or html.

As usual, be sure that the HTML Header section of the page contains your javascript code, included in the normal javascript formatting.

That should work to link the days in your calendar to a javascript.

Cheers and have a great weekend and holiday (if you are in Germany).

Jason