Ajax Region Pull - Javascript errors

Hi All,
I have tried implementing Carl Backstrom's excellent example Ajax region pull.... http://htmldb.oracle.com/pls/otn/f?p=11933:48:2576101578276736 and have been unable to get it to work. I have gone through it step by step but i still get a Javascript error relating to the function dhtml_GetReport(pThis). The error is "Object Expected on line 13" => var l_Val = html_SelectValue(pThis);
I have also included the files htmldb_html_elements.js and htmldb_get.js just in case you were wondering. We are using HTMLDB 1.6.1.00.02 if that could be the issue here.
Anyone come across this before?
Thanks.

Hello,
All those examples have been built for 2.0 and above.
Carl

Similar Messages

  • Ajax Region Pull and checksum

    I have the page, which consists the report, which has to be pulled using ajax. The problem is this page has the checksum enabled.
    I've created the start and end of the report tags on this page (<!--REPORT_START-->,<!--REPORT_END-->).
    I was able to generate the checksum but not sure how I can add it to the request for the report.
    Here's the extract of the javascript code for the page:
    var checksum=generate_checksum(url_params);
    alert(checksum) // this part works fine
    +//start ajax call+
    var ajaxReq = new htmldb_Get  (null,&APP_ID., null,2025);
    ajaxReq.add('P2025_LIST_ID',list_id);
    +...+
    report_body=ajaxReq.get(null,'<!--REPORT_START-->','<!--REPORT_END-->');
    The report body is returned only if checksum is removed.
    BTW I thought I can stick it in the querystring parameter number 7 in htmldb_get but it does not work.
    Have anybody done that ?
    Thanks for your help
    Mikhail

    Mikhail,
    I am concerned about your approach, because if you have a 'generate_checksum' JavaScript function that provides a way for you to generate a valid checksum on the client-side, what's to stop a hacker from calling that same function and easily circumventing the SSP protection on the target page?
    Have you thought of either un-restricting the target page and adding some logic to your report query to try and protect the values (eg only show certain rows for certain users, etc), or if you really want to keep the protection level on this report page, switching to a simple full page submit?
    Also, if you're on APEX 4.0, have you looked at using the 'Refresh' dynamic action? This has the same checksum restriction, but would be an easier and more supported way of approaching this in a partial page refresh way. Please see here for more geenral info. on how to do that:
    http://anthonyrayner.blogspot.com/2010/07/report-filtering-with-apex-40-dynamic.html
    Hope that helps.
    Regards,
    Anthony.

  • AJAX region pull

    I am using ajax to display a region from another page. This region has 2 text fields and a button that when pressed branches to another page. When I input the data and click the button I get an error:
    Error Item ID (10060522396890067) is not an item defined on the current page.
    Any suggestions?

    Hello Stew,
    As I suspected, your problem (and the others who started this thread) has nothing to do with the browser you are using, but in the way you are using the technique described by Carl, and was (of course) spotted correctly by Scott.
    In my answer, I’m also referencing your post in here - Re: Partial refreshing of pages in 2.0 ?
    >> I've looked at the source that's generated by my page and don't find an extraneous <form> tag
    Carl didn’t mean the <form> tag itself but to form input components in general, like items. In your case, we are talking about ‘P20_CUST_ID’, which you defined as a hidden item on page 20. Although hidden, this item is being rendered on page 20, and is included in the ‘box’ you are clipping from this page. While submitting page 2 (apply changes) the APEX engine finds on page 2 and item which not belong to this page, so it issue an error message.
    In your specific case, where the item – P20_CUST_ID – is a hidden one, the solution is very simple. Just set the condition of the item to ‘never’. That will prevent it from being rendered on page 20, so it will not be copied to page 2. I did that on your demo application, and now it seems to work just fine.
    In general, if the item you are using in the remote page must be a regular item (and not a hidden one) you need to use Scott suggestion, and put it in a region that you don’t clip as part of your AJAX process.
    Regards,
    Arie.

  • Ajax region pull bug?

    Hi,
    I have a page with two dynamic PL/SQL regions.
    I want to refresh the second one without submit my page like the following example:
    http://apex.oracle.com/pls/otn/f?p=11933:48:4181203731698424
    here is the main of the example code.
    var get = new htmldb_Get(null,$x('pFlowId').value,null,47);
    gReturn = get.get(null,'<htmldb:BOX_BODY>','</htmldb:BOX_BODY>');
    $x('ReportDrop').innerHTML = gReturn;
    The problem is that if I use such code to retreive a dynamic pl/sql region on the SAME page (i.e. 47) gReturn gets the value *','* (?!?!?)
    If I copy my dynamic PL/SQL region to another page it works fine.
    Is it an APEX bug?
    I expected that I can use AJAX refresh for a region on the same page and I don't want to replicate it.
    Thank you very much.
    Davide

    Davide,
    Interesting problem. One of the main reasons to use Ajax is to avoid a full page refresh because of all of the content that would need to be processed on the server side. If you didn't replicate the region alone on another page then you would not save any server side processing.
    As for the bug, have you used Firebug to see exactly what the Ajax call is returning?
    Regards,
    Dan
    http://danielmcghan.us
    http://www.skillbuilders.com
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Ajax Report Pull APEX_ITEM.DATE_POPUP  issue

    Hi all,
    I am trying to use something similar to Carl's Ajax Region Pull
    http://htmldb.oracle.com/pls/otn/f?p=11933:48:1222899842354681::NO:::
    So I have 2 pages. My LOV on Page 4 has an onchange event to trigger an Ajax call to page 5 which then displays the results in a region on Page 4.
    Now I am using apex_item calls to allow entry into the report on page 5. Problem is, when I have a date entry item where I have to use apex_item.date_popup then I get a javascript error similar to "genCalf01_0 is not defined" when I click on the date icon to popup the calendar.
    On my instance at work this error is only with the second date field but the first is fine. However on apex.oracle.com, both date icons trigger the problem.
    Any ideas? I have put a sample on http://apex.oracle.com/pls/otn/f?p=38748:4:2006073124664781:::::
    workspace: abots
    username: test
    password: apex_test.
    Cheers
    Kofi

    Hello,
    Using the built in form items pulled from ajax can cause alot of problems and is discouraged. In most cases when you pull a form item from one page into another page it will break your page when you try and submit it.
    Now with the date pickers there is an even bigger issue because there is also embedded individual javascript's associated with each datepicker and when you pull them into the page the page DOM will not pick them up.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Contribute Repeat Region JavaScript Error

    When one of our end users attempts to edit a page in
    Contribute (CS3) using Repeat Regions. The '+' and '-' buttons
    don't work, and when she tries to use the arrow keys, she gets the
    following error message:
    While executing onLoad in MoveRepeatEntry.htm, the following
    JavaScript error(s) occurred:
    At line 2912 of file "C:\Program Files\Adobe\Adobe Contribute
    CS3\Configuration\Shared\MM\Scripts\CMN\TemplateUtils.js":
    setSelectedNode: Argument number 1 is invalid.
    Has anyone had this error and resolved it? Thanks!
    Cliff

    Nevermind it worked i don't know how...

  • AJAX : IE JavaScript errors in "Hello Ajax" example

    hi
    In this introduction to AJAX programming:
    "Hello Ajax"! How to Do the Ajax Thing with Oracle JDeveloper
    http://www.oracle.com/technology/pub/articles/nimphius-ajax.html
    I get JavaScript errors if run the "helloajax3.html" page in MS Internet Explorer, available in:
    http://www.oracle.com/technology/pub/files/helloajax.zip
    Although there seems to be no problem in Mozilla Firefox, in IE I get this JavaSript error:
    Line: 26
    Char: 11
    Error: This method cannot be called until the send method has been called.Where line 26 has this statement:
    var status = requestObject.status;If I move the "onreadystatechange" statement in the "doTheAjaxThing()" function from this:
    function doTheAjaxThing(){
      requestObject.onreadystatechange=onReadyStateChangeResponse;
      requestObject.open("Get","myajaxcontroller?"+param,true);
      requestObject.send(null);
    }to here:
    function doTheAjaxThing(){
      requestObject.open("Get","myajaxcontroller?"+param,true);
      requestObject.onreadystatechange=onReadyStateChangeResponse;
      requestObject.send(null);
    }or to here:
    function doTheAjaxThing(){
      requestObject.open("Get","myajaxcontroller?"+param,true);
      requestObject.send(null);
      requestObject.onreadystatechange=onReadyStateChangeResponse;
    }then I get another JavaScript error:
    Line: 26
    Char: 11
    Error: The data necessary to complete this operation is not yet available.Because the error is still at line 26 I modified the "onReadyStateChangeResponse()" function like this:
    function onReadyStateChangeResponse(){
      var ready = requestObject.readyState;
      //var status = requestObject.status;
      if(ready==READY_STATE_COMPLETE && requestObject.status == PAGE_SUCCESS){
    }And now it works.
    - questions
    Does anyone have an explanation why this is no problem in Firefox and it is a problem in IE?
    Are there good guidelines available about how to approach these browser differences (and maybe a better approach to solve this particular issue)?
    many thanks
    Jan Vervecken

    Jan,
    to me this looks like a race condition and - to be honest - while writing I used Firefox. I think the safe way of solving this issue is to use one of the available Ajax libraries (e.g. Dojo) that provide you a handle to the request object. I didn't yet look at who handles the browser differences, so I cannot give you a name of a library
    Maybe http://www.ajaxian.com/ is a good starting point
    Frank

  • JavaScript error on Interactive Report

    When clicking on the Magnifying glass of my interactive report search bar, I receive a JavaScript error.
    Line: 2 Char: 15193 Error: Syntax Error
    The page that I am navigating to has 2 regions. The first is an interactive report and the second is an html region that has an Iframe reference to another interactive report. Based upon the selection of a radio group, the corresponding region(interactive report) displays. All other interactive reports work fine when their pages don't have a region with a Iframe reference.
    If I navigate to another page after the error occurs and then come back to the page, everything then works fine. The error only happens on the first use. I have installed the latest patch set for Apex 3.2 I currently am running 3.2.1.00.11. I read a bug on Metalink that referenced this javascript error, but applying the patch set does not seem to fix the issue. The bug was 8568894.
    Any help would be appreciated.

    This might be useful for others also...
    After hours and hours of debugging headers and responses and comparing pages to others which work, I realised that this interactive report's display condition is based on REQUEST = SUBMIT.
    As such, the actions menu will NOT set the Request parameter when clicking in the actions menu and the Apex engine refuses to send anything back to the browser - not even an error message.
    I'll raise a bug for this via Oracle Support.
    Cheers, Pete

  • Javascript Error - Uncaught ReferenceError: $s is not defined in ApEx 3.0.1

    Hi,
    I am using Oracle ApEx 3.0.1 and am trying to implement the Ajax Loading animation on a report I am running. The problem though, is that I am getting a javascript error on the following line:
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 10);Looks like in Oracle ApEx 3.0.1, I am getting the javascript error:> Uncaught ReferenceError: *$s is not defined*
    What would I need to change, to get this to work with no javascript errors in Oracle ApEx version 3.0.1 ?
    Thanks.
    Tony.

    Hi,
    It might be that $s function is not introduced on 3.0
    Try
    window.setTimeout('document.getElementById("AjaxLoading").value=document.getElementById("AjaxLoading").HTML)', 10);Regards,
    Jari

  • While executing applyServerBehaviour in ShowifRSNotEmpty.htm, a JavaScript error occurred?

    Hi forum,
    Long time no post!
    Well, I've been trying out mySQL and Dreamweaver. I've found a book called Dreamweaver MX 2004 Design Projects and I am trying to write and get working Allan Kent's News Portal site as it seems to have all the things I want to learn in it.
    However, my question is this:
    When I have put in this code:
    <p>
      <span class="Headline"><?php echo $row_rstLatestNews['news_headline']; ?></span><br />
      <img src="showimage.php?show=icon&story=1" class="imgLeft" width="60" height="60" />
      <?php echo
    $row_rstLatestNews['news_pk']; ?>"    <?php echo
    $row_rstLatestNews['news_icon_meta']; ?>  /><?php echo
    $row_rstLatestNews['news_precis']; ?><br />
    <a href="news.php?story=<?php echo
    $row_rstLatestNews['news_pk']; ?>" class="More">Read More</a>
    </p>
    and then highlight all of the <p> to </p> (i.e. everything above) and apply show region if recordset Not Empty Server Behaviour
    it says:
    "While executing applyServerBehaviour in ShowifRSNotEmpty.htm, a JavaScript error occurred."
    what does this mean?
    why is it doing this?
    Please help!
    T.

    tomcausland wrote:
    I did this and it didn't work, I deleted the file and then it generated a new one.
    Yes, it will generate a new one. That's the idea of deleting the one that has become corrupted. However, if it didn't fix the problem, it could mean that an extension is causing problems. The next stage is to delete or rename your personal configuration folder. Doing so reverts Dreamweaver back to all its default settings, and should clear any problem. However, your later comments suggest the problem might lie elsewhere.
    May I ask, what is SQL injection and what is insecure code?
    Sure, you can ask, but a quick Google search would bring you the answer much quicker than waiting for me to have time to reply. Read the following page, and you'll understand what SQL injection is and why code vulnerable to is is insecure: http://en.wikipedia.org/wiki/Sql_injection.
    The exercise to create a news website uses server behaviours. I have gone through the exercise and it didn't seem to work properly. So I went through and tried reapplying server behaviours and this is when I get the error message opening and closing the server behaviours. When it happens once it happens to all of them so I have to reboot DW.
    I have read that server behaviours have a logical order on a web page and changing one effects the operation of others.
    Server behaviors are simply PHP code that has been generated automatically by Dreamweaver. When applied correctly, they should work without problem. However, a lot of people use them without understanding any of the code generated by Dreamweaver. That's when problems arise. If you make a mistake, you can't just select things in Design view and press Delete. To remove a server behavior cleanly, you need to select its name in the Server Behaviors panel, and click the minus button.
    Also, I know that Allan's instructions involve editing server behavior code. Once you do so, Dreamweaver usually no longer recognizes it as a server behavior, so you need to edit the code entirely in Code view. If you're not sure what you're doing, problems can again arise. I would suggest wiping the page clean, and starting again.
    Allan is an experienced author and PHP developer, so I assume that his instructions are correct. However, mistakes do occur in books. I see there is no errata page for that book, but that doesn't mean it's free of mistakes. I submitted corrections to a couple of my books several months ago, but friends of ED hasn't bothered to put them on its website. You can download the example files for that book. If there's a set of complete files, test them in a browser. Then compare your files with the author's.

  • While executing ObjectTag in flash.htm, a javascript error occurred

    I'm attempting to place a SWF file in an editable region on a page created from a template.  I get the error: While executing ObjectTag in flash.htm, a javascript error occurred.  I saw on another sight that someone found the problem which was editable regions remove the head tag information.  But I do not know how to enter this info.  I tried just putting  a </head> and a head and body tag in code view inside the name region but this did not work. Any help would be appreciated.

    Main.dwt
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body {
    background-color: #00C;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    #container {
    background-color: #FFF;
    width: 900px;
    margin-right: auto;
    margin-left: auto;
    #flashbanner {
    background-color: #FFF;
    height: 350px;
    width: 900px;
    #title {
    background-color: #FFF;
    height: 35px;
    width: 900px;
    #navtop {
    background-color: #FFF;
    height: 100px;
    width: 900px;
    #spacer1 {
    background-color: #00C;
    height: 20px;
    width: 900px;
    #navleft {
    background-color: #FFF;
    float: left;
    height: 1200px;
    width: 250px;
    border-right-width: medium;
    border-right-style: solid;
    border-right-color: #00C;
    #mainbody {
    background-color: #FFF;
    height: 1200px;
    width: 646px;
    float: left;
    #spacer2 {
    background-color: #00C;
    height: 20px;
    width: 900px;
    clear: both;
    #navbottom {
    background-color: #FFF;
    height: 100px;
    width: 900px;
    #spacer3 {
    background-color: #00C;
    height: 20px;
    width: 900px;
    -->
    </style></head>
    <body>
    <div id="container"><!-- TemplateBeginEditable name="flashbanner" -->
      <div id="flashbanner">flashbanner</div>
    <!-- TemplateEndEditable --><!-- TemplateBeginEditable name="title" -->
    <div id="title">title</div>
    <!-- TemplateEndEditable -->
    <div id="navtop">nav top</div>
      <div id="spacer1"></div>
      <div id="navleft">nav left</div>
      <!-- TemplateBeginEditable name="mainbody" -->
      <div id="mainbody">mainbody</div>
      <!-- TemplateEndEditable -->
      <div id="spacer2"></div>
      <div id="navbottom">nav bottom</div>
      <div id="spacer3"></div>
    container</div>
    </body>
    </html>
    Index.htm
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body {
    background-color: #00C;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    #container {
    background-color: #FFF;
    width: 900px;
    margin-right: auto;
    margin-left: auto;
    #flashbanner {
    background-color: #FFF;
    height: 350px;
    width: 900px;
    #title {
    background-color: #FFF;
    height: 35px;
    width: 900px;
    #navtop {
    background-color: #FFF;
    height: 100px;
    width: 900px;
    #spacer1 {
    background-color: #00C;
    height: 20px;
    width: 900px;
    #navleft {
    background-color: #FFF;
    float: left;
    height: 1200px;
    width: 250px;
    border-right-width: medium;
    border-right-style: solid;
    border-right-color: #00C;
    #mainbody {
    background-color: #FFF;
    height: 1200px;
    width: 646px;
    float: left;
    #spacer2 {
    background-color: #00C;
    height: 20px;
    width: 900px;
    clear: both;
    #navbottom {
    background-color: #FFF;
    height: 100px;
    width: 900px;
    #spacer3 {
    background-color: #00C;
    height: 20px;
    width: 900px;
    -->
    </style></head>
    <body>
    <div id="container"><!-- InstanceBeginEditable name="flashbanner" -->
      <div id="flashbanner">flashbanner</div>
    <!-- InstanceEndEditable --><!-- InstanceBeginEditable name="title" -->
    <div id="title">title</div>
    <!-- InstanceEndEditable -->
    <div id="navtop">nav top</div>
      <div id="spacer1"></div>
      <div id="navleft">nav left</div>
      <!-- InstanceBeginEditable name="mainbody" -->
      <div id="mainbody">mainbody</div>
      <!-- InstanceEndEditable -->
      <div id="spacer2"></div>
      <div id="navbottom">nav bottom</div>
      <div id="spacer3"></div>
    container</div>
    </body>
    <!-- InstanceEnd --></html>

  • Interactive report javascript error: missing ) in parenthetical

    Running on 11g, APEX 3.1.2.00.02:
    I have several interactive reports that appear to the user to hang up when they try to sort by clicking a column header (the spinny circles never go away and the page doesn't do anything). Upon the column header click, Firebug reports a javascript error: "missing ) in parenthetical", which I now believe is related to this string:
    <SCRIPT SRC="/oracle_smp_chronos/oracle_smp_chronos.js"></SCRIPT>
    being appended to the results of an AJAX call the report makes to get refreshed data.
    I believe the expected result data (JSON format?) is no longer valid with that string at the end.
    We had to prevent that from happening when running our own onDemand service, but I don't know how to stop it in this case.
    Has anyone seen, or solved, this one before? Can anyone tell me how to turn off that smp_chronos stuff to see if I'm right? It's for performance monitoring or some such, isn't it?
    TIA,
    AFC

    Our DBA tells me: there is a setting in the web cache called End-User Performance monitoring. it need to be disabled ( "Site-Specific End-User Performance Monitoring Rules")
    This took care of the problem.
    Thanks for listening.
    AFC

  • APEX_ITEM.DATE_POPUP javascript error

    Hi there
    I have a dynamic report I have built where the date popup has stopped working.
    The date popup works fine for other form fields in other regions on the page but within my dynamic sql report region the javascript is erroring when clicing on the calendar image.
    The Apex version is 2.2.
    The code in the dynamic report is: APEX_ITEM.DATE_POPUP(5,rownum,action_date_time,'dd-MON-RR',9) action_date_time
    The Jscript error is basically: document.forms.0.f05.length is null or not an object.
    The input object in the HTML source is: <input type="text" name="f05" size="9" maxlength="2000" value="03-OCT-06" style="padding-right:5px;" />
    And the Jscript which refers to it is immediately after:
    function genCalf05_0()
    elemArrLen = 0;
    if (document.forms[0].f05.length) {
    elemArrLen = document.forms[0].f05.length;
    ... etc...

    I have discovered why the calendar control is not working -
    As a customisation I included another <form> tag in the menu which is interfering with the popup (forms[0]).
    I may need to look into either doing my customisation a different way (it is above the standard form tag in the menu) or see if I can write some type of custom calendar popup.
    When the calendar control in the actions region is built - some javascript is written by APEX which I have no control over - it looks like
    " if (document.forms[0].f05.length) {
    elemArrLen = document.forms[0].f05.length;
    }"

  • Bugreport: creating a mobile Listview region results in error

    Hi,
    i'm on apex.oracle.com creating a mobile application. When creating a new region of type report -> Listview it results in an error if the query is too big (or returns too many columns).
    The error is: Error during rendering of region "Add Javascript code for Plugins". ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    The query i used: SELECT * FROM APEX_APPLICATION_PAGE_ITEMS
    brgds,
    Peter
    get Syntax Highlighting for the Application Builder: http://apex.oracle.com/pls/apex/f?p=APEX_DEVELOPER_ADDON:ABOUT:0:::::
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at and http://www.wirsindapex.at
    Fantastic Plugins for APEX: http://www.tryfoexnow.com

    Hi Peter,
    I have filed bug 16396195 - ora-06502 raised when creating list view if sql returns too many column
    for this issue.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Javascript error on SharePoint page

    Hi Team,
    I'm updating a list column value by comparing a value of field from the same list using JS. It is working fine. But throwing javascript error on the page. 
    Below is the snippet.
    var web = null;
    var clientContext = null;
    var list = null;
    var item = null;
    var reviewStatus = null;
    $(document).ready(function () {
    setInterval(function () {
    $Text = $("td.ms-cellstyle.ms-vb2:contains('No')");
    $Text.parent().css("background-color", "#FFb3BD");
    $("input[name='teamCheckbox']").change(function () {
    var controlid = $(this).attr("id");
    var parts = controlid.split('_');
    var itemID = parts[1];
    clientContext = new SP.ClientContext(_spPageContextInfo.webAbsoluteUrl);
    var list = clientContext.get_web().get_lists().getById(_spPageContextInfo.pageListId);
    item = list.getItemById(itemID);
    clientContext.load(item);
    clientContext.load(item, 'Status');
    clientContext.executeQueryAsync(Function.createDelegate(this, LoadStatus), Function.createDelegate(this, onQueryFailed));
    }, 900);
    function LoadStatus() {
    reviewStatus = item.get_item('Status');
    if(reviewStatus)
    item.set_item('Status', 0);
    item.update();
    clientContext.load(item);
    clientContext.executeQueryAsync(Function.createDelegate(this, UpdateNo), Function.createDelegate(this, onQueryFailed1));
    }else
    item.set_item('Status', 1);
    item.update();
    clientContext.load(item);
    clientContext.executeQueryAsync(Function.createDelegate(this, UpdateYes), Function.createDelegate(this, onQueryFailed1));
    function onQueryFailed() {
    alert("Request Failed at 1st asych");
    function onQueryFailed1(){
    alert("Request Failed at 2nd asynch");
    function UpdateYes() {
    //reviewStatus = null;
    function UpdateNo()
    //reviewStatus = null;
    I'm getting the below JS error :
    Message: The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested. URI: _layouts/15/sp.debug.js?rev=vK8qdKxCg9qccxdMK5Ebzg%3D%3D
    $Q_2: function SP_ListItem$$Q_2($p0) {
    var $v_0 = (this.get_fieldValues())[$p0];
    if (SP.ScriptUtility.isUndefined($v_0)) {
    throw Error.create(SP.ResResources.getString(SP.ResourceStrings.propertyHasNotBeenInitialized));
    return $v_0;
    I have tried by calling the 2nd async query by changing to item.get_Context(); doesn't helped me.
    Please suggest how to kill this error...
    Thanks,
    Bharath P N
    P N Bharath

    Hi Dennis,
    I had tried by updating the script. But it is failing in update the list item. Please let me know if i'm doing wrong?
    $(document).ready(function () {
    setInterval(function () {
    $Text = $("td.ms-cellstyle.ms-vb2:contains('No')");
    $Text.parent().css("background-color", "#FFb3BD");
    $("input[name='teamCheckbox']").change(function () {
    var controlid = $(this).attr("id");
    var parts = controlid.split('_');
    var itemID = parts[1];
    var ctx = GetCurrentCtx();
    var listName = ctx.ListTitle;
    var url = _spPageContextInfo.webAbsoluteUrl;
    var currentStatus = null;
    var Status = null;
    getListItemWithId(itemID, listName, url, function (data) {
    if (data.d.results.length == 1) {
    currentStatus = data.d.results[0].Status;
    }, function (data) {
    alert("Error in GetListItemwithID method");
    if (currentStatus) {
    Status = 0;
    updateListItem(url, listName, itemID, Status, function () {
    alert("Item updated, refreshing avilable items");
    }, function () {
    alert("Ooops, an error occured. Please try again");
    } else {
    Status = 1;
    updateListItem(itemID, listName, url, Status, function () {
    alert("Item updated, refreshing avilable items");
    }, function () {
    alert("Ooops, an error occured else loop. Please try again");
    }, 900);
    function getListItemWithId(itemId, listName, siteurl, success, failure) {
    var url = siteurl + "/_api/web/lists/getbytitle('" + listName + "')/items?$filter=Id eq " + itemId;
    $.ajax({
    url: url,
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (data) {
    success(data);
    error: function (data) {
    failure(data);
    function GetItemTypeForListName(name) {
    return "SP.Data." + name.charAt(0).toUpperCase() + name.split(" ").join("").slice(1) + "ListItem";
    function updateListItem(itemId, listName, siteUrl, title, success, failure) {
    var itemType = GetItemTypeForListName(listName);
    var item = {
    "__metadata": { "type": itemType },
    "Status": title
    getListItemWithId(itemId, listName, siteUrl, function (data) {
    $.ajax({
    url: data.d.results[0].__metadata.uri,
    type: "POST",
    contentType: "application/json;odata=verbose",
    data: JSON.stringify(item),
    headers: {
    "Accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "X-HTTP-Method": "MERGE",
    "If-Match": data.d.results[0].__metadata.etag
    success: function (data) {
    success(data);
    error: function (data) {
    failure(data);
    }, function (data) {
    failure(data);
    P N Bharath

Maybe you are looking for

  • Updated iPhone / iTunes and now cannot Import CDs

    OS: Win7 Home Premium iTunes: 10.1.0.56 Yesterday I decided to take the plunge and started importing my CD collection. About 30 CDs in I decided to take a break. I plugged in my iPhone and hit the update button in iTunes. (I'm not sure if I got the i

  • Controlling Documentation

    Dear All,                 In our company we are not implemented Controlling.So, I want Controlling Configuration & End user Manual Documentation.Can any one provide me. Thanks & Regards, Prasanna.M

  • I did a some reminders where do I find them on my mac

    I did a some reminders where do I find them on my mac

  • Use of S-Video?

    What can the S-Video imput be used for? Anything practical, like a satellite feed?

  • 848p neo problems PLEASE HELP!!!!

    just got a new 848p neo, celeron 2ghz/400, and a stick of 512 2700... put it all in my computer, hooked up the hard drive cd rom etc.... and booted up, boots up but when windows loads it stops halfway thru the windows startup screen and shows a blue