Event handling in javascript

I have a jsp page which should display a javascript message prompting the user to save the changes made on a page when he clicks on a link to another view, but only if he has changed the values in any fields in the current page. So I need to capture onChange events for any element in the form.
Can an onChange event be handled at the window or document level?

Thanks for the responses. I managed to find the javascript solution to my problem. The following function storeChange() is called when the page is loaded.
var isDirty = false;
function storeChange() {
  if(navigator.appName.indexOf("Microsoft Internet Explorer") != -1){
    for (i=0; i < document.form1.elements.length ; i++) {
      document.form1.elements.attachEvent("onchange",setDirtyFlag);
else if(navigator.appName.indexOf("Netscape") != -1) {
document.captureEvents(Event.CHANGE);
document.onchange=setDirtyFlag;
function setDirtyFlag() {
isDirty = true;
So any form element's onChange event triggers the setDirtyFlag() method. On submit of the page, i check this flag to determine if any values were modified. I have tested this code with IE6.0 and NS4.7.

Similar Messages

  • C# control event handling with javascript

    How can I get javascript to execute for "onchange" / "OnSelectedIndexChanged" event instead of a CodeBehind method? I think "OnSelectedIndexChanged" event has to be handled by CodeBehind; but how can I replace that (or onchange) with
    a javascript event handler?
    I have the following in my xyz.ascx file:
    <asp:DropDownList ID="ddlTypeCar" CssClass="BatsRefAddressTypes" runat="server"
                      onchange="javascript: testAlert();"
                      OnSelectedIndexChanged="ddlTypeCar_SelectedIndexChanged"
                      AutoPostBack="True" />
    I could not get the javascript to execute, even though I removed OnSelectedIndexChanged="ddlTypeCar_SelectedIndexChanged" and/or set AutoPostBack="false".
    Additionally, I tried added the following in xyz.ascx.cs Page_Load() method.
    ddlTypeOfAddress.Attributes.Add("onchange", "javascript: testAlert();");
    which didn't help.
    Thanks for your help in advance.

    Hi,
    you can control client events instead of server events with javascript
    look this url for more information
    http://www.w3schools.com/js/js_events.asp
    Regards

  • Javascript embedded in button pl/sql event handler not being executed

    Javascript calls not working from pl/sql button event handler. What am I missing? Are specific settings needed to execute javascript from pl/sql proceedures?
    Example: Want to toggle target='_blank' off and on in a button pl/sql event handler to open url call in new window & then reset when processing submit is done & the app returns to the form.
    portal form button's pl/sql submit handler:
    begin
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    end ;
    Putting the following in the button's javascript on_click event handler works great:
    this.form.target='_blank'
    to force opening new window with a call in the button's submit pl/sql code via:
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    but then the target='_blank' is left on when the submit is done & we return to the form.
    putting the above javascript as a function (called fcn_newpage) elsewhere (e.g., after form opens) & calling in the submit pl/sql with
    htp.p('fcn_newpage') ;
    also doesn't work.
    Metalink thought this was an application issue instead of a bug, so thought I'd see if anyone knows what's going wrong here. (Portal 9.0.4.1)

    thanks for your discussion of my post.
    Please clarify:
    "htp.p('fcn_newwindow') sends a string":
    What would you suggest the proper syntax for a function fcn_newwindow() call from a pl/sql javascript block that differs from
    htp.p('<script language="Javascript">') ;
    htp.p('fcn_newwindow');
    htp.p('</script>');
    or more simply
    htp.p('fcn_newwindow') ;
    More generally, what I'm trying to figure out is under what conditions javascript is executed, if ever, in the pl/sql of a button (either the submit or custom event handler, depending on the button).
    I've seen lots of posts asking how to do a simple htp.p('alert("THIS IS TROUBLE")') ; in a pl/sql event handler for a button on a form, but no description of how this can be done successfully.
    In addition to alerts, in my case, I'd like to call a javascript fcn from a pl/sql event handle that would pass a URL (e.g., http://www.oracle.com) where the javascript fcn executed
    window.open(URL). The API call to set_target(URL) in pl/sql has no ability to open in a new window, so calling that is inadequate to my needs and I must resort to javascript.
    Its clear in the PL/SQL of a button, you can effect form components since p_session..set_target & p_session.get_target set or get the contents of form components.
    So to see if javascript ever works, I tried to focus on something simple that only had to set what amounts to an enviromental variable when we returned to the form after a post. I chose to try to change the html value of TARGET from javascript in the PL/SQL button because it doesn't need to be implemented until we finish the post and return to the form.
    So I focused on a hack, setting this.form.TARGET='_blank' in the on_click event handler that forced every subsequent URL call or refresh of the form to be a new window. I then wanted to turn off opening new windows once I'd opened the URL call in a new window by setting TARGET='' in the portal form. I can achieve what I want by coding this.form.TARGET='' in the javascript (on_focus, on_change, or on_mousedown, ...) of every form component that might refresh the form. However, that is a ridiculous hack when a simple htp.p('<script>') ; htp.p('this.form.target=""') ; htp.p('</script>') ; at the end of the button's pl/sql event handle should do the same thing reliably if javascript ever works in the pl/sql event handler.
    If we didn't have access to form components through p_session calls, I'd assume it was a scope issue (what is available from the pl/sql event handler). But unless my syntax is just off, when, if ever, can javascript be used in a portal form's pl/sql event handler for a button?
    if I code a javascript funtion in the forms' pl/sql before displaying form:
    htp.p('<script language="JavaScript">') ;
    htp.p('function fcn_new_window(URL)') ;
    htp.p('window.open(URL)' ) ;
    htp.p('</script>') ;
    the function can be called from a button's on_click javascript event handler:
    fcn_new_window('http://www.oracle.com')
    but from the same button's pl/sql submit event handler this call doesn't work: htp.p('fcn_new_window("http://www.oracle.com")')
    So my questions remain: Is there other syntax I need, or does javascript ever work properly from the pl/sql of a form button's event handler? If it doesn't work, isn't this a bug that should be fixed by Oracle?
    I can probably figure out hacks to make things work the way I need, but executing javascript from pl/sql event handlers seems to be the expected way to affect portal html pages (forms, reports, ...) and it seems not to work as expected. I don't feel I should have to implement hacks for something as simple as calling a javascript function from pl/sql when almost every example I've found in metalink or the forums or Oracle Press's "portal bible" suggests using javascript from pl/sql via the utility htp.p() to effect web page components in portal.
    My TAR on the subject, while still open, returned the result basically: "We can reproduce your situation. Everything looks okay to us, but we can't explain how to use javascript where you want or point you to any documentation that would solve your problem or expain why it should not work the way you want it to. We don't feel its a technical issue. Why don't you post the problem on the portal applications forum."
    I'm hoping I'm just missing something fundamental and everything will work if I implement it a little differently. So if anyone sees my error, please let me know.
    by the way, not sure this is germain, but in reference to your comment:
    "redirections in pl/sql procedures give a peculiar result. in a pl/sql procedure, usually, portals give the last redirection statement and ignore anything else coming after it."
    if I try to raise an alert:
    htp.p('alert("you screwed up")');
    return;
    in a pl/sql event handler, it still doesn't raise the alert, even though its the last thing implemented in the event handler. But if I set the value of a text box using p_session..set_value_as_string() at the same spot, it correctly sets the text box value when I return to the form.

  • Help with Javascript error in event handler slowing animation down.

    Hi all--
    I did an animated book cover for my publisher, Baen Books, but an error keeps coming up in my animation.  The actual animating can be viewed here:
    http://baen.com/310x204/A_CallToDuty.html
    As you can see, when the error pops up, the animation grinds to a halt, an it has to recover.  I am not well enough versed in javascript to know what is going on. The error code below repeats over and over again as it plays.
    6Javascript error in event handler! Event Type = timeline edge.3.0.0.min.js:171
    3
    <error> VM26:184
    Javascript error in event handler! Event Type = timeline edge.3.0.0.min.js:1714Javascript error in event handler! Event Type = timeline edge.3.0.0.min.js:1713
    <error>
    If anyone has an idea what is causing this, I would be extremely grateful for  any help.
    David Mattingly

    Hi Hemanth--
    I put it in a dropbox folder for you here:
    Dropbox - EdgeAnimation
    This contains 2 versions--a small one for the preview, and then a larger one when people click on the cover preview. Thanks in advance for your help.\
    David Mattingly

  • Javascript error in event handler! edge 4.0.0.js, what to do about it?

    Site
    Hello everyone. I get an error in my chrome cosole, what can I do about this?
    I dont have this problem in all browsers, just in chrome, and in some versions of Firefox.
    The problem occurs when I click any label in the iframe (see website, speaks for itself).
    line 5838      window.console.log("Javascript error in event handler! Event Type = " + eventType);
    does anyone know how to fix this?
    And why do I only have this problem in some browsers?

    I basically want the labels in the Iframe to make the parent page animate to a specific anchor tag.
    ps. This is what I posted on the jquery forum as well:
    I tried to do this by letting the iframe .trigger a .click to a button on the .parent page.
    I did this in two ways.
    one: the click is triggerd in (/by) the iframe
    two: the click is triggerd by a script in the parent window, that script is launched by the iframe
    Here's the thing:
    this is what one of the <a>'s that the iframe will click looks like:
    <a class="nonblock nontext anim_swing" id="u185" href="index.html#contact"><!-- simple frame --></a>
    The code is generated by adobe muse which has a function to smoothly scroll to a location on the page, and I am guessing the "anim_swing" class takes care of that.
    I would like the colorful labels in the iframe to do the same thing as the <a> above.
    and it works in some browsers on some computers but somehow not on all of them (with method two the adblocker doesn't seem to be an issue ).
    I also tried to let the parent page scroll directly with the jquery .scrollto function. That did not work either (see the jquery forum).

  • Javascript error in event handler event type = timeline

    Hi,
    I have a small EdgeAnimate projekt with version 1.5.0 and the local export works fine... I must include the package at a CMS and I update all paths to absolute paths and all files are loading...
    but I the animation dont play - I see at the javascript console the follow output
    javascript error in event handler event type = timeline   edge.1.5.0.min.js:143
    Springender Punkt: Rettungswagen - Der springende Punkt
    I dont found any solution... :-((

    Hi Scott,
    I have gone through your shared composition created in older verion of Edge.
    If you open the older composition html page in browser, there already have some of the error messages in the console as you mentioned above like
          Javascript error in event handler! Event Type = timeline.
    And as you said with the latest Edge, when you upgrade the old composition, some new error messages gets added to the existing ones.
    As in the latest Edge, the whole of runtime has been shake-up, some of the attributes has been removed and are added in different way.
    Example: To access timelines of a symbol:
         Old way:           sym.timelines['Default Timeline']
         New way:          sym.data[sym.name].timeline
    You need to make some modifications in index_edgeActions.js file like:
         1. Search & Replace "timelines['Default Timeline']" with "data[sym.name].timeline"
         2. And in the code taken from EdgeCommons.js, replace "getVariable("symbolSelector")" with "_variables["symbolSelector"]".
    Hope, these changes will remove the new JS issues you mentioned.
    hth,
    Vivekuma

  • Javascript error in event handler! Event Type = element [edge.2.0.0.min.js:162]

    I'm doing a little edge project (now in beta version) for my girlfriend (she hates the code), with examples of the animate() method and other functions like setInteval(), but when I run I get the following error in Chrome console:
    Javascript error in event handler! Event Type = element [edge.2.0.0.min.js:162]
    But this library is global for all projects, how is possible that trigger an error?
    Example here:
    https://app.box.com/s/m7nof4al6597gfn47jlu
    Thanks.

    you dont need to import java ease !!
    it's already included in edge animate, remove that yepnope completely your problem will gone
    Zaxist

  • Javascript event handling

    The following code is being executed three times in the
    following sequence:
    1) On initialization of my Flex application, initCallback()
    is called
    2) When I broadcast a 'getUserPreferencesFromCookie' event,
    handleGetUserPreferenceCookie() is called.
    3) When I broadcast a 'writeUserPreferencesCookie' event,
    handleWriteUserPreferenceCookie() is called.
    // Callback when flash is initialized
    var initCallback = function()
    // Add all event listeners
    FABridge.flash.root().getPreferences().addEventListener(
    "getUserPreferencesFromCookie",
    handleGetUserPreferenceCookie);
    FABridge.flash.root().getPreferences().addEventListener(
    "writeUserPreferencesCookie",
    handleWriteUserPreferenceCookie);
    FABridge.flash.root().getPreferences().faBridgeInitialized();
    // Listen for flash initialization (i.e. the Main application
    is created)
    FABridge.addInitializationCallback("flash", initCallback);
    // Event handler for Get User Preferences Cookie Events
    events
    var handleGetUserPreferenceCookie = function(readEvent)
    alert("Getting Cookie for user: " +
    readEvent.getUsername());
    if (readEvent.getUsername())
    var theCookie = readCookie(readEvent.getUsername());
    alert("Returned from readCookie: '" + theCookie + "'");
    var preference = FABridge.flash.root().getPreferences();
    if (preference)
    if (preference.setPreferenceCookie)
    preference.setPreferenceCookie(theCookie);
    else
    FABridge.flash.root().getPreferences().setPreferenceCookie(null);
    // Event handler for Write User Preferences Cookie Events
    events
    var handleWriteUserPreferenceCookie = function(writeEvent)
    alert("Creating Cookie for User");
    if (writeEvent)
    alert("Write event is defined");
    var username = writeEvent.getUsername();
    if (username)
    // Create a cookie given the username and the XML
    createCookie(writeEvent.getUsername(),
    writeEvent.getData());
    alert("Returned from creating cookie");
    else
    alert("Write event is undefined");
    alert("Write cookie method completed");
    Here is the problem:
    handleGetUserPreferences() completes as expected (i.e. the
    cookie string is set into my preferences object). The readEvent is
    a custom event that extends flash.events.Event. However, when
    writeUserPreferenceCookie is called, the line
    writeEvent.getUsername() fails. writeEvent is the same type of
    event as readEvent. And when I say 'fails' I mean that the method
    goes no further. I never see the 'Write cookie method completed'
    alert. There are no errors in the Javascript Error Console.
    I've checked the writeEvent on the action script side. The
    username has been set into the event the same way that it was set
    into the readEvent. I cannot see why I can get data out of the
    readEvent but not the writeEvent.
    ANY help would be much appreciated.
    -Julie

    Just because the forums are a little slow on a weekend...
    JavaScript functions should be declared in the HEAD of an HTML page. I wasn't aware that a function declared in the BODY writes to a new document, so I've also learned something out of this.
    Take this and work on it to place the output where you want it:<html><head><script type="text/javascript"><!--
      function clickfunction()
        //if (registration.purpose[0].checked==true)
          document.getElementById("stuffHere").innerHTML = "Name of School/ College: <input type=text name=sname><br>Grade / Year:<input type=text name=grade>";
    !--></script></head>
    <body>
      <table>
        <tr>
          <td><font size = "" color="purple">Age:</font></td>
          <td><input type = "text" name = "age" size = "10" maxlength = "3"></td>
        </tr>
        <tr>
          <td><font size = "" color = "purple">Select the best reason
            <br>to use the Library:</font></td>
          <td><input type = "radio" name = "purpose" value = "school" onClick = "clickfunction()">
            <font size = "" color = "purple" >School / College</font><br>
              <input type = "radio" name = "purpose" value="work">
                <font size = "" color = "purple">Work</font><br>
              <input type = "radio" name="purpose" value="personal">
                <font size = "" color = "purple">Personal</font>
          </td>
          <!--// SET AN ID ON THE ELEMENT! //-->
          <td id="stuffHere"></td>
        </tr>
      </table><br>
      <form>
        <input type="Submit" name="register" value="Register" align="MIDDLE">
        <input type="reset" name="clear" value="Clear Form" align="MIDDLE">
      </form>
    </body></html>db
    -- next time, no JavaScript questions, please!
    edit What you wanted to do was<div id="div1" style = 'display:none;'>and in the functiondocument.getElementById("div1").style.display = "block";Edited by: Darryl.Burke

  • Handling Custom JavaScript Events from HtmlLoader Class

    Hey guys, just a quick question, Is it possible to handle custom javascript events just the way standard events like locationchange and DOMInitialized are handled. Say for example a HTML5 slide application that dispatches custom events when the user moves from one slide to another. I know there is an option to use ExternalInterface to talk to AS3 but for this project of mine, this is not an oiption as this HTML5 Presentation doesnt have any swf content to bridge with.
    Its just a thought since the HTMLloader has access to the javascript window object(or am i wrong). Would it be possible to access a custom function as a prototyped property of the window Object.
    Any form of tip/clarification will be appreciated.
    thanks!

    Use the HTMLHost class. You create a subclass of HTMLHost and override certain methods that are called in response to certain JavaScript behaviors. Then you assign an instance of your HTMLHost to the HTMLLoader's htmlHost property. (Since you're using the Flex HTML component, you would assign your HTMLHost subclass instance to the HTML control's htmlHost property.)

  • Javascript Submit button onclick event handler

    Hi,
    I am having trouble getting the onclick event handler of a form to execute when the button is pressed. I am trying to open a page in a new window depending on if the user selects that option in a checkbox.
    There is one form(id='graphform') and 2 submit buttons, each with a checkbox before it. I want the new window to open only iuf the right checkbox and matching submit button has been checked.
    One of the checkbox/button pair: The onclick="checkWindow('w1','graphform');" is never getting called.
    <input type="checkbox" id="w1" name="win1" style="margin-right: 10px" value="window"  onclick="javascript:document.gform.win1[0].checked = true;"><a style="margin-right: 10px">Graph in new window</a>
    <input type="submit" value="Create graph" onmouseover="this.form.cumulat.value='0';this.form.graphGroup.value='Consumption'; document.getElementById('hintSubmitStop').value='1';" onclick="checkWindow('w1','graphform');" onmouseout="document.getElementById('hintSubmitStop').value='0';" /></td></tr>Javascript window opener:
    function checkWindow(win1, str){
              var formObj = document.getElementById(str);
         var checkBoxObj = document.getElementById(win1);
         if(checkBoxObj1.checked == true){
                   formObj.target = "_blank";     
                   formObj.action = "graphDisplayFrame.jsp";     
         else if(checkBoxObj1.checked == false){
                   formObj.target = "_self";
                   formObj.action = "graphDisplay.jsp";
    }Any suggestions?
    J

    You're storing the value in "checkBoxObj" and in the next line you use different variable name as "checkBoxObj1".
         var checkBoxObj = document.getElementById(win1);
         if(checkBoxObj1.checked == true){
    instead of "true', try      if(checkBoxObj.checked == 1){

  • How to write an JavaScript Event Handler for Portal Form?

    I have created an form in Portal builder.
    There are two column, R04 and R05.
    I need to use Javascript Event Handler to check if R04 value is smaller than R05 value.
    Can I be able to build up this function?
    Can anyone give me a hint? or steps?
    Thanks

    Here are some suggestions.
    1. do what we did, and write your own protocol server that understands whatever custom commands you need, and then write a custom thin client which will send commands to and receive responses from this protocol server. you can use any language for the client software. the protocol server should be written in java so that it can receive commands from the client and then use the 9iFS API to execute the requests or retrieve the data that the client wants to display.
    2. write a custom fat client, in java, that accesses the 9iFS API directly. this means that each client will be accessing the iFS schema on the database machine directly. if you configure the iFS service on the client to use the THIN driver, then you won't need to install the Oracle client software on the client machine. You'll just need all the iFS .jar files and the database's JDBC driver (classes12.zip). Note that using the THIN driver is not supported because of bugs and performance problems. If you use the OCI8 driver, which is supported, then you'll have to install the whole Oracle client software package on the client machine.
    3. write a thin client that uses the WebDAV protocol, and communicate with our built-in DAV server. this approach will allow you to execute any command that DAV understands. you may be able to find some free HTTP or DAV client software on the net, or you can try writing it yourself. this is probably a better solution than number 1 unless you really need to send custom commands that are not in our DAV server's vocabulary.

  • Dropdown box - which event handler to use ?

    I am having trouble with setting the readonly property (via Javascript) of the adjacent textbox to my dropdown box when the index value is a certain number.
    I tried using MouseUp, MouseDown, and even OnBlur....but the readonly does not seem to be getting set to true or false consistently.
    Could this be a timing issue ? The textbox that I am trying to control is the next tab-order control in the list of controls for this page.
    This same logic is working fine in the MouseUp event handler for check boxes. So I am just wondering if this is a bug or must my implementation change to accomodate dropdown boxes ? For instance, should I move the logic to the Enter event handler of the textbox instead ? Can a control's own eventhandler set itself to readonly when it is the active form field ?

    After tons and tons of testing time, I've come to the conclusion that dropdowns are totally buggy in 11.0.07 release of Acrobat Pro.
    Even if you set the "commit values immediately", you get the PRIOR selected item's value as the event value, not the CURRENT one.
    This occurs in a Validate event handler script. I have not been able to use any other event handlers for a dropdown except the OnBlur....and then, for my purposes, IT'S TOO LATE !!!
    This is totally worthless as I need to setFocus() and set fields to readonly based on the immediate dropdown offset or face value.

  • The onDeactivate event handler doesn't work in InDesign CC. Why?

    Hi guys.
    I’m working on a script in Javascript for InDesign CC.
    The big problem is that the onDeactivate event handler doesn’t work.
    Here’s an example that works in InDesign CSx but not in InDesign CC:
    #target indesign
    var w = new Window ("dialog", "Test onDeactivate");
    var et_1 = w.add("edittext", [undefined, undefined, 300, 30], "Lorem ipsum");
    var et_2 = w.add("edittext", [undefined, undefined, 300, 30], "Dolor sit amet");
    var st = w.add("statictext", [undefined, undefined, 300, 30], "CONSOLE:\r\r", {multiline: true});
    et_1.onDeactivate = et_2.onDeactivate = function(){
         st.text = "CONSOLE: I left the field with this text:\r\t«" + this.text +"»"; }
    var b_ok = w.add("button", undefined, "OK");
    w.show();
    The script shows a dialog window with 2 edit text fields: when a field loses the focus (clicking on the other one), the «CONSOLE» shows the text of the old field.
    Adobe, please, fix this issue as soon as possible.
    Thanks.
    Giorgio

    It's a bug, and it has been reported. Please report it yourself, the more reports the better. It's no good asking Adobe in this forum to fix something.
    Peter

  • Event handler when using partial page refresh ?

    Hi
    I have a calendar, which uses partial page refresh. The problem is how to make javascript wait until the calendar has loaded and then do some updates on the calendar (after the user has pressed the next button that runs apex.widget.calendar.ajax_calendar('S','next');, for example ). I thought I could add "onreadystatechange" (or onload) event handler to the calendar like this: onreadystatechange="checkState()", where the function would check the state and if ready then do the updates. This doesn't work. Could somebody please tell me why not ?
    Tiina

    Hi,
    It seems that ajax calendar missing event apexafterrefresh.
    I do not know is this "bug" or just feature.
    That event would be useful to your case , if I understand correct what you looking for.
    For workaround , you can over write original function by placing this to calendar region footer
    <script>
    apex.widget.calendar.ajax_calendar=function(p_calendar_type, p_calendar_action, p_calendar_date, p_calendar_end_date){
    var l_cal_type_field = $v('p_cal_type_field_id');
    var l_cal_date_field = $v('p_cal_date_field_id');
    var l_cal_end_date_field = $v('p_cal_end_date_field_id');
    var l_cal_id = $v('p_calendar_id');
    var l_calendar_region = 'calendar' + l_cal_id;
    if ( p_calendar_type != 'C' ){
      $s(l_cal_date_field,$v('p_calendar_date'));
    }else{
      if ( $v(l_cal_date_field) == '' ) {
       $s(l_cal_date_field,$v('p_calendar_date'));
      if ( $v(l_cal_end_date_field) == '' ) {
       $s(l_cal_end_date_field,$v('p_calendar_end_date'));
    // create and apex.ajax.widget object
    var a = new apex.ajax.widget('calendar',function(){
      /* start the return function */
      if(p.readyState == 1){
       document.body.style.cursor = "wait";
      }else if(p.readyState == 2){
      }else if(p.readyState == 3){
      }else if(p.readyState == 4){
       $x(l_calendar_region).innerHTML = p.responseText ;
       $s(l_cal_date_field,$v('p_calendar_date'));
       if (p_calendar_type == 'C') $s(l_cal_end_date_field,$v('p_calendar_end_date'));
       document.body.style.cursor = "";
      /* DO HERE THINGS AFTER CALENDAR REFRESH */
      }else{return false;}
    // code for next,previous and today
    if (p_calendar_type == 'S'){
      p_calendar_type = $v('p_calendar_type');
    }else{
      $s(l_cal_type_field,p_calendar_type);
    a.ajax.addParam('p_widget_mod',p_calendar_type);
    a.ajax.addParam('p_widget_action',p_calendar_action);
    a.ajax.addParam('x01',l_cal_id);
    var lDate = (!!p_calendar_date && p_calendar_date !== '')?p_calendar_date:$v(l_cal_date_field);
    if (p_calendar_type == 'C') {
      var lendDate = (!!p_calendar_end_date && p_calendar_end_date !== '')?p_calendar_end_date:$v(l_cal_end_date_field);
    a.ajax.add(l_cal_date_field,lDate);
    if (p_calendar_type == 'C') a.ajax.add(l_cal_end_date_field,lendDate);
    a.ajax.addParam('x02',lDate);
    if (p_calendar_type == 'C') a.ajax.addParam('x05',lendDate);
    a.ajax.add(l_cal_type_field,p_calendar_type);
    a._get();
    </script>Where I have comment *"do here things after calendar refresh"*, you can hook own scripts.
    Of course this is not best way, but might help you till ajax calendar support dynamic actions fully
    Regards,
    Jari
    Edited by: jarola on Oct 20, 2010 3:11 PM

  • Unusual Event Handling Priorities

    This may be a pretty esoteric situation, but just thought I
    would bring it up.
    I have an application that uses events to show a particular
    component and hide the rest. Showing and hiding also triggers
    transition effects like fade in/out for the components that
    appear/disappear.
    One of these components deals with loading an external AS2
    SWF using javascript. If for some reason that load fails, there is
    am ExternalInterface.addCallBack registered method that gets called
    by javascript, that is supposed to then show some other component
    and hide the rest, indicating the failure.
    The issue I am seeing is that the method that handles the
    setting of the component visibilities is getting interrupted by the
    javascript addCallBack return call from javascript.
    Essentially, what it looks like is as follows:
    1) dispatch show 'game' component event
    2) event handler sets game component to visible
    3) the onShow event for the game component immediately calls
    javascript to show AS2 game (the event handler has not finished
    yet... it still needs to try to hide the rest of the components)
    4) The javascript AS2 game loader immediately fails (div
    missing, swfobject failure, etc.) and calls the callback function.
    5) Before execution finished of the original event handler,
    the callback asynchronously does all of its handling and dispatches
    another show/hide components event
    6) This brand new event is process and handled IMMEDIATELY,
    and the handler completes
    7) The original event only now finishes processing the rest
    of the original handler request
    Setting the priority on the addEventListner to even something
    like 2147483648 does nothing to change this behavior. Any event
    called from addCallback handlers seem to be infinite priority.

    If I remember correctly, the trick was to use dynamically registered events. Once the first is fired, unregister for it while you react to it. The complete code of course went even trickier, so as Lynn suggested, try to dig that thread on the forum (searching for 'dynamically registration of events' might help).
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

Maybe you are looking for