ApEx Calendar Region - enhanced behavior using JavaScript

Hi everyone,
I recently wrote about the built in calendar. Comments/remarks are welcome! :)
http://insum-apex.blogspot.com/2008/07/apex-calendar-enhanced-behavior.html
Louis-Guillaume
Homepage : http://www.insum.ca
Blog : http://insum-apex.blogspot.com

Hi Emma,
You could do it with an POP-UP LOV and Dynamic Action.
Dynamic Action
- Change
- item P65_STAFF_ID
True Actions
1 - PL/SQL block;
     - PL/SQL Code in this block you can get the last of first date for the absence of the STAFF_ID and put it in the date item for the calendar (eg P65_CALENDAR_DATE);
     - Page Items to Submit P65_STAFF_ID
     - Page Items to Return P65_CALENDAR_DATE
2 - Execute Javascript Code
     - apex.widget.calendar.ajax_calendar('M','same',$v('P65_CALENDAR_DATE'));
This way the calendar will be refreshed and set to the date in P65_CALENDAR_DATE.
You can also put "null;" in the PL/SQL block, leave the Page Items to Return empty and remove the ",$v('P65_CALENDAR_DATE')" part from the Javascript code. This way you do not open the calendar at the right date.
I made a small example at http://apex.oracle.com/pls/apex/f?p=14257:4 (login as demo/demo).
Regards,
Kees Vlek
<tt>Company: http://www.orcado.nl
Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
Twitter: http://www.twitter.com/skier66</tt>
If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.

Similar Messages

  • Apex Calendar

    The APEX calendar region has built in buttons to navigate to the next, previous and current months. I have a report region next to my calendar that displays every month that has data in my calendar table and I have made the month a link but I am not sure how to make the calendar switch to that particular month when I click the link.

    Hi,
    You will need to have the built in item ':pXXX_calendar_date' updated by the link in your report with the proper date in this format 'YYYYMMDD'. This will change what date the calendar is looking at. This will work
    Cheers Mike
    Edited by: MikesHotRod on Sep 2, 2008 9:04 AM

  • How to retrieve value of one column to other in Apex using Javascript

    Hi all,
    Can any one help me in solving this problem.
    How to send a value from one column to another column using javascript in Apex. I heard that we can use onChange().
    My requirement is,
    I have a column(Varchar2) in form where i need to enter a value and the data need to be sent to another column(Number) when i press apply changes.
    ex: if i enter a value say 1/3 or 1/4 or 1/3*1/6
    the result should be entered in the other column.
    Message was edited by:
    Raman

    Try something like
    html_GetElement('P1_ITEM2').value = eval(html_GetElement('P1_ITEM1').value);

  • Use multiple day event in Calendar region

    I am using a Calendar region in my application. One issue i have run into is, some of my events are multiple-day events, such as a conference. The calendar application does not seem to be able to deal with multiple-day events. It takes one date as the date. There doesn't seem to be any way of dealing with multiple day events. In my case, I have 2 date fields in my table associated with my calendar - a starting date, and an ending date.
    Has anyone found a way to deal with this situation? I don't want to have a separate entry for each date of the event. I'd like to be able to use my start date, and ending date fields.
    Thanks,
    John

    Scott,
    I took the SQL you used in your trigger and substituted my table names and fields. I am getting 3 errors. Here is what my code looks like after the substitutions (my table names are 'meetings_tbl' and 'meetings_tbl_cal'):
    CREATE OR REPLACE TRIGGER ai_meetings
    AFTER UPDATE OR INSERT ON meetings_tbl
    FOR EACH ROW
    DECLARE
    l_date_diff NUMBER;
    BEGIN
    IF UPDATING THEN
    DELETE FROM meetings_tbl_cal WHERE m_id = meetings_tbl.m_id;
    END IF;
    l_date_diff := meetings_tbl.meeting_end - meetings_tbl.meeting_start;
    FOR x IN 0..l_date_diff
    LOOP
    INSERT INTO meetings_tbl_cal
    (m_id, meeting_date)
    VALUES
    (meetings_tbl.m_id, TO_DATE(meetings_tbl.meeting_start + x));
    END LOOP;
    END;
    I am getting 3 errors:
    1) PL/SQL: ORA-00904: "MEETINGS_TBL"."M_ID": invalid identifier
    2) PLS-00357: Table,View Or Sequence reference 'MEETINGS_TBL.MEETING_END' not allowed in this context
    3) PL/SQL: ORA-00984: column not allowed here
    Maybe I'm not supposed to substitute ':NEW' with 'MEETINGS_TBL' ??
    Thanks for your help!
    John

  • How to resize a region in a SMIL presentation, using Javascript?

    I have Quicktime player embedded in HTML page. The src is link to SMIL text on my server. The presentation works fine, but I couldn't find any way to re-size its regions dynamically, using Javascript.

    Before posting, please TRY and do a search on the forum, you MIGHT find your question already asked and ANSWERED..: place a reports region on center of the page
    Thank you,
    Tony Miller
    Webster, TX
    On the road of life...There are 'windshields', and there are 'bugs'
    (splat!)
    "Squeegees Wanted"

  • Using Javascript in a report region

    I have a text box that I need to populate with an amount for billing. There is also a field that shows the amount due. If the amount due is equal to the amount being paid, I want my user to click on the amount due, and it automatically populates the amount being paid. I am using the javascript:setValue('destination','origination'); command, but the problem is that I am unable to choose the text field in the javascript. I have tried using #value# aliasing, and htmldb_application.g_f0x and just f0x... nothing seems to properly alias the text box within the tabular form. Any ideas?
    Thanks,
    Scott

    Scott,
    I know a way to do this, but it is not an easy implementation and it is quite hard to explain. Carl is an Oracle guy so he may know of a better solution, but here is what I came up with on my own:
    First let's be familiar with the htmldb_item syntax (found in the html db documentation):
    HTMLDB_ITEM.TEXT(
    p_idx IN NUMBER, -- unique id
    p_value IN VARCHAR2 DEFAULT NULL, -- value of item
    p_size IN NUMBER DEFAULT NULL, -- HTML tag attributes
    p_maxlength IN NUMBER DEFAULT NULL, -- max length
    p_attributes IN VARCHAR2 DEFAULT NULL, -- HTML elements including where you incorporate the javascript for this item
    p_item_id IN VARCHAR2 DEFAULT NULL, -- id you can specify
    p_item_label IN VARCHAR2 DEFAULT NULL) -- labe you can specify
    I would create your report region using the following sql statement:
    select order_number "Order Number",
    name "Name",
    amount_due "Amount Due",
    lpad((ROW_NUMBER() OVER (ORDER BY order_number)),4,0) "Row Num",
    htmldb_item.text(7,amount_paid,null,null,null,'f07_'||lpad((ROW_NUMBER() OVER (ORDER BY order_number)),4,0) "Amount Paid"
    from tbl_orders
    where....
    order by order_number
    --i had to use an order by to get the ROW_NUMBER() to work
    This will create on every row an item that is specific to the row number. For example:
    Row # Amount Paid text box item ID
    1 f07_0001
    2 f07_0002
    500 f07_0500
    etc.
    This will allow you to reference items based on what row they are when using javascript.
    Next you need to create a link out of the the amount_due column. Go to the Report Region, then the Report Attributes tab. Click on the edit link for the amount_due column. Go to the Column Link section.
    Make link_text = to the value of amount_due column(#amount_due# probably)
    Make the Target = URL
    Make URL = javascript: setValues('#AMOUNT_DUE#','#ROW_NUM#');
    This will send the value of amount due and the row number.
    Here's the javascript you would put in your HTML Header on you Page Attributes:
    <script language="JavaScript1.1" type="text/javascript">
    function setValues(due, rownum){
    document.getElementById('f07_'+rownum).value = due;
    </script>
    Give that a shot. I just created a page and got that to work.
    Chris

  • ICS 2: Can I change the format of the date displayed by Calendar Server from M/D/Y to D/M/Y using JavaScript?

    Can I change the order in which the month and day are displayed in Calendar
    Server using JavaScript? Specifically, I would like the date to be displayed
    in the format D/M/Y instead of M/D/Y.
    <P>
    Yes. You can change the format of the date by editing the JavaScript variable
    in the file <I>
    loadpoint</I>/CalendarServer/cal/uicust/en/main.html
    . The variable is located in the
    "Misc" section in the
    following line:<BR>
    <P>
    i18n['def date order'] = 'M/D/Y';
    <P>
    Edit the line as follows:<BR>
    <P>
    i18n['def date order'] = 'D/M/Y';

    Hello Mark,
    yes, it is possible. In Calendar Express under
    "Options | Settings -> Date"
    "Show brief dates in the following order: Date, Month, Year".
    BTW.: iCS 5.0 P4 is out since August, 2001. It's worth upgrading!
    Regards,
    Jakob.

  • Using javascript in apex

    I am using javascript in apex, specifically the funtion popupURL. It is doing exactly what I want it to do except I don't want a new window, I want to stay in the same window.
    What is the javascript function that will do the same as popupURL - except it stays in the current window?
    Thanks!
    Stan Collins

    I think sb92075 was suggesting that you might have better luck finding someone with the answer Oracle Application Express (APEX)

  • Branch process using javascript to call popup

    I am on Windows Vista, Oracle XE and Apex 3.1.0.00.32.
    The branch works when using region based button.
    I wanted to use a "button displayed among this region's items" for a "button" list in the sidebar. I created a button and used a branch based on :REQUEST = 'button_name'. The branch fires but I get an error "Internet Explorer cannot display the webpage."
    HTML header code
    <script language="JavaScript" type="text/javascript">
    function popup(pURL, pwidth, pheight) {
    html_PopUp(pURL,"winLov",pwidth,pheight);
    </script>
    Branch Code
    javascript:popup('f?p=&APP_ID.:10012:&APP_SESSION.:&REQUEST.::10012:P10012_ISS_ID:&P10011_ISS_ID.',500,350);
    Since the code works in the URL redirect on a Button in a region position but not in a Branches redirect to a URL I assume this functionality does not work? Can anyone shed light on this? If it doesn't work I will need to find another solution....
    Thanks,
    Sam
    I did search and found a thread that intimates it should work.
    link:calling javascript on a branch is this possible
    Edited by: slavanaway on Mar 23, 2009 4:14 PM

    Luis,
    I see that I did not put more detail into the issue than the title.
    I am trying to call a popup from a button among region items. The user makes a selection then some custom DDL fires and the popup closes and the calling page is refreshed.
    A button among region items does not have a redirect to URL like a button in a region position. So I made the branch that was conditional on the button. I think I knew that a "branch" is server side. I don't understand why the jvascript URL does not work.
    A button in a region position and a list that redirects to a URL both work. I wanted the list to look like button in a vertical row.
    I now have the functionality working with a list.
    So I am coming to the mountain to get enlightenment. The Branches on a page can not use javascript is my guess and being eternally curious I was wondering why. I hope knowing will help me save time and produce better apps in the future.
    As for the actual behavior. When the Branch for the button amonth the region items fires. I would get the error message and the URL would only show apex flows. I don't have the exact URL as I dis-assembled the list and branches.
    I think the branch goes to the server but either the javascript is not passed or it does not handle the javascript.
    Tx,
    Sam

  • Custom pagination for APEX 4.2 interactive report using Page Zero

    Hi,
    I want to implement an «Custom pagination for APEX 4.2 interactive report» using a «page zero».
    I recently migrate from Apex 3.1 to Apex 4.2 and my «Custom pagination for APEX 3.1 interactive report» using a «page zero»  is not working any more.
    So now I try to adapt an excellent example of Jari Laine for 4.0 but using a page zero.
    I put the code JavaScript to Page zero but I must create an dynamic action to fire only for an interactive report region.
    It’s a good idea?
    Thank you

    Thought I would try once more with my DatePicker question.
    On the Apex.Oracle.Com website I have created a 1 page application that has an Interactive Report.
    [url http://apex.oracle.com/pls/apex/f?p=15655:1]
    user = 'test'
    password = 'test'
    I have 2 questions :
    (1) In IE7, press 'Actions', 'Filter'. On the Column dropdown list, select 'Order Timestamp'.
    Notice the prompt icon to the right of the 'expression'. This should change to the Datepicker, but in IE7 it does not. Try the samething in Firefox or Chrome and the Datepicker will appear.
    Is this a BUG, or does Apex 4.02 not support IE7 ?
    (2) In Firefox or Chrome, where you can now see the Datepicker, you will notice that it is the new style picker, not the old style ( called 'classic' ). I want to change it so that it shows the 'classic' datepicker not the new, but cannot see how to do it, if indeed you actually can.
    I would really appreciate it if someone could take a look and let me know if I am going mad, or if we need to get all our users onto IE8. We have now gone live with Apex 4.02 and need to resolve these issues.
    Thanks in advance.
    Edited by: DooRon on 10-Mar-2011 05:13

  • About APEX Calendar views (monthly, weekly, daily)

    Hi,
    How can I display a DAILY APEX CALENDAR?
    I read in some APEX-related articles that it is possible to have 3 different views: monthly, weekly, and daily.
    example 1. http://insum-apex.blogspot.com/2008/07/apex-calendar-enhanced-behavior.html
    example 2. http://examples.apex-evangelists.com/pls/apex/f?p=286:29:0:::::
    I tried to follow the directions given in one of those examples but I found out that the tags in my local environment differ from the ones shown in the example. I don't have the MONTHLY CALENDAR, WEEKLY CALENDAR and DAILY CALENDAR tabs mentioned in the example.
    Please help.

    Hi user10284066,
    Thank you for mentioning this link http://insum-apex.blogspot.com/2008/07/apex-calendar-enhanced-behavior.html
    in this forum. Helped a lot.
    For people who want to know where to find these tabs,
    Home>Application Builder>Application XXX>Shared Components>Templates
    select calendar and you must see those(monthly, weekly, daily) tabs under
    Home>Application Builder>Application XXX>Shared Components>Templates>Edit Calendar Template
    or upgrade to a newer version

  • Javascript errors - Summing columns using Javascript

    Hi
    I have two regions on a page which are tabular forms that I have manually setup using APEX_ITEMS that I would like to use some JavaScript to pick up the values entered and sum that row up. I used Vikas example for tabular form calculation and it works perfectly for 1 region however if I have two regions it seems to give me the following error message in Firefox:
    g_table.rows[rownum].cells[getCellPos(g_table, html_GetElement("COL05"), "column")] has no properties
    Which I gather is because there are two columns on the page named COL05 and idea how I could get around this problem.
    I've put an example here: http://apex.oracle.com/pls/otn/f?p=35414:4

    Hello,
    It could be a bit difficult to auto sums a row, as
    usually rows include non-numeric columns. In any
    case you can always use a computation column in your
    select statement, or build a derived column in the
    report attributes tab. The problem is to update these
    columns in real-time, after a specific cell has been
    changed, and for that you need JavaScript.I realised this thats why I wanted to pickup the column and Row and then I would be able to replace the value in the specified column ie. total column using javascript for each row.
    I’m not sure I’m following you, but if you mean the
    current (active) rownum per displayed report page,
    you can use the #FIRST_ROW_FETCHED# and
    #LAST_ROW_FETCHED# substitution strings, in the
    footer of the report region.
    If you meant something else, please elaborate a bit
    more.Look at the revised demo app http://apex.oracle.com/pls/otn/f?p=35414:4 as you can see in this particular example each region returned 15 rows of data. I wondered if there was a way to pick up the last row returned so that I could use the same javascript function I use to calculate the rows I could update that specific column/total row. Example, in my demo app you will see a null row returned I would like to find this row then update the values.

  • Example of setting page item using javascript

    Does anyone have an example of setting the value of a page item (hidden) using javascript? I have seen the following in the Forum but I am having trouble implementing it. If someone could show an example of a region it is called from, and the javascript (and where it is placed), that would be great.
    I have tried something similar to this without luck so far:
    function setValue(){
    $x('P1_FIELD').value = 'Oracle';
    Thanks!
    John

    Hi VS,
    you should really use a "Set Value" dynamic action for that, that's much more transparent than using the onclick definition in the button attributes.
    Regards
    Patrick
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Can I use JavaScript to force objects to overlap a Web Object in Captivate 7?

    Hi, so I have all of these great ideas for using Web Objects to enhance my courses, but am discouraged by the fact that I can't seem to get anything to overlap a Web Object. The only thing I can seem to get to overlap a Web Object is another Web Object. I have found that buttons seem to still work under the Web Object (which is good) but I really would like to know of a way to allow things on the Captivate timeline to be viewed on top of them. Things like text fields and images.
    I've seen posts about how to use JavaScript to have the menu show above Web Objects, but that code doesn't seem to work for regular objects. I read that Web Objects sit in an "<iframe>" tag and that that forces it to appear above everything else. I'm left wondering if it is possible to get around this by somehow putting Captivate objects in an <iframe> of their own with JavaScript? Or is there some other way? Does anybody know any JavaScript I can apply to Captivate objects to get them to appear above a Web Object?
    Thanks,
    Dan

    So I have come to learn that the "<iframe>" tag for a Web Object is simply a window that sits on top of the course. Now I'm wondering if anyone has an effective method for importing flash quality animation (in whatever form) that can sit underneath of Captivate objects and still be HTML5 compliant?
    Thanks,
    Dan

  • How to pass a single quote in a URL using Javascript

    Can someone tell me how to pass a single quote in a URL using Javascript. I have created a Javascript funciton in which I pass several column values from an APEX report.
    The URL for the report link I am using is "JAVASCRIPT:passBack('#EMP_ID#','#Name#','#e-mail#')"
    The problem occurs with the Name and e-mail columns contain a single quote (i.e. James O'Brien)

    Thank you Saad, that worked.
    Since I built the report using type 'SQL Query (PL/SQL function fody returning SQL query)' I had to add some additional quotes to get it to work.
    i.e.
    replace(EMP_EMAIL_NAME,'''''''',''\'''''')
    or
    replace(EMP_EMAIL_NAME,chr(39),''\'''''')
    Thanks for the help,
    Jason

Maybe you are looking for

  • External drive with A-TV

    Hello, Recently my laptop broke down and it doesn't look like it's worth the price to fix/replace...however I do have over 2TB worth of mkv/rm video on my external hard drive. Is there a way to connect my external to Apple TV without any bootable pc/

  • Duplicating address data option for second applicant with a check box

    I've been searching and trying things out for hours now, without success. I'm not sure if this is PDF Forms question or whether I should be posting to the Java forum, but here it is: I have an PDF application form with several fields for mailing addr

  • Comment télécharger une versio d'essai de Photoshop cs6

    Bonjour, je cherche à télécharger la version d'éssai de photoshop cs6 et n'y arrive pas, merci de votre aide Message was edited by: PECourtejoie

  • Simultaneous signals into waveform graph

    I am trying to use a VI to test multiple components' voltage inputs and outputs and I have developed the following VI.  The problem I am seeing is that when I operate two components, the DAQ assistant sends the two signals in series and my waveform g

  • Running Classic on 10.4.6

    I have a new MacBook running 10.4.6, I had a PowerBook G4 running 10.4.6. When I purchased the MacBook, at the Apple Store, they did a data transfer from the PowerBook to the MacBook. When I try to open an old application, Claris HomePage, the only C