Not able to use window.addEventListener method in JSLink javascript

Hi,
I have developed 2 app parts and passing values between them using post message utility of windows. It works fine from script editor web part but fails when I am trying to use it as JSLink.
I am getting window is undefined error message.
I was wondering if I can use window.addEventListener from javascript which is referenced in JSLink property.
Can anyone please help. 

Check if below helps
<script language="ecmascript" type="text/ecmascript">
var listItem;
var list;
var clientContext;
function getSetListItem() {
this.clientContext = SP.ClientContext.get_current();
if (this.clientContext != undefined && clientContext != null) {
var webSite = clientContext.get_web();
this.list = webSite.get_lists().getByTitle("Custom");
this.listItem = list.getItemById(3);
clientContext.load(this.listItem);
this.clientContext.executeQueryAsync(Function.createDelegate(this, this.OnLoadSuccess),
Function.createDelegate(this, this.OnLoadFailed));
function OnLoadSuccess(sender, args) {
var value = this.listItem.get_item("SampleOne");
this.listItem.set_item("SampleTwo", value);
this.listItem.update();
this.clientContext.load(this.listItem);
this.clientContext.executeQueryAsync(Function.createDelegate(this, this.OnLoadSuccess1),
Function.createDelegate(this, this.OnLoadFailed));
function OnLoadSuccess1(sender, args) {
alert(this.listItem.get_item("SampleTwo"));
function OnLoadFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}</script>
<input id="btnGetSetListItem" onclick="getSetListItem()" type="button" value="Get & Set List Item" />
function AddCar() {
//Retrieve the txtCar and check if it has some text.
var txtCar = document.getElementById("txtCar");
if (txtCar.value == "") {
alert("please enter a car");
return;
//Retrieve the clientContext
var clientContext = SP.ClientContext.get_current();
//Retrieve the current website
var webSite = clientContext.get_web();
//Retrieve the lists
var lists = webSite.get_lists();
//Get the Cars List
var carsList = lists.getByTitle("Cars");
//Create new IteamCreationInformation
var itemCreationInfo = new SP.ListItemCreationInformation();
//the addItem takes the itemCreationInformation object
//and returns the listItem
var listItem = carsList.addItem(itemCreationInfo);
//Set the title of the list Item
//to the value in the txtCar
listItem.set_item("Title", txtCar.value);
//Call Update the listItem
listItem.update();
//Finally execute the operation
//pass to it a 2 callBack methods OnSucceed and OnFailure
clientContext.executeQueryAsync(
Function.createDelegate(this,this.Succeeded)
,Function.createDelegate(this,this.Failed));
Finally add the 2 CallBack method
function Succeeded() {
alert("Succeeded");
function Failed(sender,args) {
alert("fail");
Or 
try 
http://stackoverflow.com/questions/23134018/onclick-javascript-send-value-to-another-control

Similar Messages

  • Not able to use Mac after booting windows from bootcamp!

    Hello,
    In my Mac mini, I dual booted it by installing windows on it using bootcamp!
    Could you help me how to go to mac partition and i am also not able to use windows!
    Pls help
    Punit Khatri
    +91-9925326095

    Hi there:
    You may be able to start up the Mac in such a way as to look
    for an OS X volume at the same time using a keyboard comb-
    ination at startup... Press key(s) immediately after start tone.
    Press Option (opt) key during startup will start in Startup Manager
    where you can select an OS X volume or network volume to run.
    {There is also a way to choose a hardware test for diagnostic
    purposes on startup, too. Some macs have features in the OS
    to include a 'recovery' mode on later models.}
    • Startup key combinations for Intel-based Mac:
    http://support.apple.com/kb/HT1533
    PS: if you decide to remove Windows, you should also
    consider Boot Camp to remove the partition it made.
    Hopefully this helps.
    Good luck & happy computing!

  • I just buy an Ipad2, and I am not able to use my Apple ID to download Apps. Each time, a window open and ask me to fill my billing informations (my Security Code). The problem is every time I put this number and click ''done''...say contact Itunes support

    I just buy an Ipad2, and I am not able to use my Apple ID to download Apps. Each time, a window open and ask me to fill my billing informations (my Security Code). The problem is every time I put this number and click ''done''...say contact Itunes support

    Contact iTunes:
    Apple - Support - iTunes - Contact Us

  • Not able to use adobe reader 9 on windows 7 OS

    Hi All,
    i have problem with adole reader 9. if i installed on PC i can able to use only PDF file but can not able to use any other executable file.
    all other executable flogo show icon of adobe reader.
      For using other executable file i need to remove adoble reader installer from operating system and then only i can able to use other application on my PC.
    Kindly sugest me as i facing this problem since long time. your prompt revert would be appriceated.
    Thanking you.
    Atul

    Use the forum for Adobe Reader.

  • Not able to install windows 7

    Hi - I am not able to install windows 7 in my imac (latest version). When I try using the bootcamp, it gets stuck at the place where I am asked to partition the hard disk for the windows system and does not go any further. Has anyone experienced such a scenario?

    This is one method.
    1. Remove 240G SSD from Optibay.
    2. Re-install Optical drive.
    3. Boot from 240G SSD using an external enclosure/SATA-to-USB connector. You can also boot from an external flash drive as mentioned in OS X: Installing OS X on an external volume - Apple Support.
    4. Run BCA and format the 128G for Windows completely.
    5. Install Windows.
    6. Remove the Optical drive and install the 240G SSD and test.

  • Can't enroll device for user and this user account is not authorized to use Windows Intune.

    Hello,
    We have SCCM 2012 R2 inegrated with intune via an intune subscription. When I enroll a device with my admin account there are no problems, but when I want to add it with another user account which is a member of the Intune users collection, it can't be enrolled.
    When I tested on https://portal.manage.microsoft.com with the credentials of the user I couldn't connect and received the following error: This user account is not authorized to use Windows Intune.
    Do I have to do anything in the https://accounts.manage.microsoft.com as there is a checkbox saying Windows Intune. this is unchecked now for all the users even my own account on which I'm able to enroll a device.
    Or is this a license problem? I know configuration Manager uses licenses for Intune but where can we track how many licenses are used and how many available? Is there some kind of report available?
    I hope someone can help me
    Kind regards,
    Robben

    I added them yesterday and this morning I was still not able to enroll a device with the added user his credentials.
    The UPN is correct. Maybe I need to force the DirSync then? Or will one day of waiting be enough normally?
    I can see the user in the intune management portal. Does this means it has been synced?
    Another thing I noticed is the cloudusersync.log doesn't show them being added? What I was thinking is I first used the all Users collection in the subscription and afterwards I changed it to a specific collection with only the test users. Could it be that
    they all synced already and the log doesn't show them anymore?
    A warning in this log shows this also:
    WARNING: Failed to get lsu url. default release one will be used. exception = System.NullReferenceException: Object reference not set to an instance of an object.~~   at Microsoft.ConfigurationManager.DmpConnector.UserSync.CloudUserUpload..ctor()  
     SMS_CLOUD_USERSYNC    23/04/2014 15:02:18    7684 (0x1E04)
    I don't know if that has anything to do with this?
    this is an extract of that log:
    CCloudUserSync::Process - User sync processing thread is now stopping.    SMS_CLOUD_USERSYNC    23/04/2014 14:59:42    8144 (0x1FD0)
    SMS_EXECUTIVE started SMS_CLOUD_USERSYNC as thread ID 7684 (0x1E04).    SMS_CLOUD_USERSYNC    23/04/2014 15:02:15    7572 (0x1D94)
    CCloudUserSync::Process - User sync processing has started.    SMS_CLOUD_USERSYNC    23/04/2014 15:02:15    7684 (0x1E04)
    Starting user sync ...    SMS_CLOUD_USERSYNC    23/04/2014 15:02:15    7684 (0x1E04)
    WARNING: Failed to get lsu url. default release one will be used. exception = System.NullReferenceException: Object reference not set to an instance of an object.~~   at Microsoft.ConfigurationManager.DmpConnector.UserSync.CloudUserUpload..ctor()  
     SMS_CLOUD_USERSYNC    23/04/2014 15:02:18    7684 (0x1E04)
    Starting user delta sync, raise failure status messages = True    SMS_CLOUD_USERSYNC    23/04/2014 15:02:18    7684 (0x1E04)
    Total received users from SCCM to be removed from cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:02:19    7684 (0x1E04)
    Successfully removed users from cloud 0    SMS_CLOUD_USERSYNC    23/04/2014 15:02:19    7684 (0x1E04)
    Total received users to add from SCCM = 0, Total Successfully added users to Cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:02:19    7684 (0x1E04)
    UserDeltaSync:- Users Added = 0, Users Removed = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:02:19    7684 (0x1E04)
    Starting user delta sync, raise failure status messages = True    SMS_CLOUD_USERSYNC    23/04/2014 15:07:19    7684 (0x1E04)
    Total received users from SCCM to be removed from cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:07:19    7684 (0x1E04)
    Successfully removed users from cloud 0    SMS_CLOUD_USERSYNC    23/04/2014 15:07:19    7684 (0x1E04)
    Total received users to add from SCCM = 0, Total Successfully added users to Cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:07:19    7684 (0x1E04)
    UserDeltaSync:- Users Added = 0, Users Removed = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:07:19    7684 (0x1E04)
    Starting user delta sync, raise failure status messages = True    SMS_CLOUD_USERSYNC    23/04/2014 15:12:19    7684 (0x1E04)
    Total received users from SCCM to be removed from cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:12:19    7684 (0x1E04)
    Successfully removed users from cloud 0    SMS_CLOUD_USERSYNC    23/04/2014 15:12:19    7684 (0x1E04)
    Total received users to add from SCCM = 0, Total Successfully added users to Cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:12:19    7684 (0x1E04)
    UserDeltaSync:- Users Added = 0, Users Removed = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:12:19    7684 (0x1E04)
    Starting user delta sync, raise failure status messages = True    SMS_CLOUD_USERSYNC    23/04/2014 15:17:19    7684 (0x1E04)
    Total received users from SCCM to be removed from cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:17:19    7684 (0x1E04)
    Successfully removed users from cloud 0    SMS_CLOUD_USERSYNC    23/04/2014 15:17:19    7684 (0x1E04)
    Total received users to add from SCCM = 0, Total Successfully added users to Cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:17:19    7684 (0x1E04)
    UserDeltaSync:- Users Added = 0, Users Removed = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:17:19    7684 (0x1E04)
    Starting user delta sync, raise failure status messages = True    SMS_CLOUD_USERSYNC    23/04/2014 15:22:19    7684 (0x1E04)
    Total received users from SCCM to be removed from cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:22:19    7684 (0x1E04)
    Successfully removed users from cloud 0    SMS_CLOUD_USERSYNC    23/04/2014 15:22:19    7684 (0x1E04)
    Total received users to add from SCCM = 0, Total Successfully added users to Cloud = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:22:20    7684 (0x1E04)
    UserDeltaSync:- Users Added = 0, Users Removed = 0    SMS_CLOUD_USERSYNC    23/04/2014 15:22:20    7684 (0x1E04)
    kind regards,
    Robben

  • Dynadock U3.0 - Not able to use Ethernet port after Win 8.1 update

    Hi everybody,
    i am using a Dynadock u3.0 dock with my Vaio SCP 13.
    Since I updated my device to Windows 8.1 Update 1 I am not able to use the Ethernet port of the Dynadock.
    Before that everything worked fine.
    I am not able to reinstall the drivers correctly (tried 7.6m0, 7.5m2). While the driver insaller tries to start i am getting an error message, that the installer is not able to set a bunch of registry Keys (SYSTEM\CurrentControlSet\Services\DisplayLinkGA\D evice1) (till 0). (Image 1)
    If i ignore those messages and do install the driver, the Ethernet port will remain uninstalled in the device manager. (Image 2)
    If I try to install the driver manually (DisplayLink Network Adapter NCM), Ill get an error message that a driver was found but that the access was denied. (Image 3)
    I started the safe mode and could install the driver. But if I reboot to normal mode, the device could not be started.
    I also tried to disable UAC and I am logged in as the "real" administrator.
    Please find the error messaged attached (in German):
    [image 1]: http://picload.org/image/lcalwop/toshiba.png
    [image 2]: http://picload.org/image/lcalwoc/toshiba2.png
    [image 3]: http://picload.org/image/lcalwlg/toshiba3.png
    BTW: If I unzip the installer (7.6m0) and install the *inf for the right ven&dev (4503) it still does not work...
    I dont know what to do anymore...

    Hi
    After Windows 8.1 upgrade, you should also update the Display Link driver/software
    This is very important!
    The latest driver can be downloaded here:
    http://www.displaylink.com/support/downloads.php
    Note: the old version should be removed!

  • I am not able to use my external hard drive with my Mac.

    I am not able to use my external hard drive with my Mac. It was initially used with my Windows 7 laptop. Now when I insert my Hard drive in the Mac, it doesn't allow me to delete, format, make folders or copy new files on to my hard drive. I no longer have a Windows PC and am stuck. I tried going to Disc utilities,selected my HD, clicked on Erase and then changed the Format type to MS-DOS (FAT) but no luck .. Any other steps or advice?

    It was likely formatted in NTFS which is readable by the Mac, but not writeable.
    You should be able to reformat the disk in Disk Utility.
    After having copied all the data off of it, you can try re-partitioning it.
    Select the hard drive in the disk list in Disk Utility. Hard drives are the device itself, are left-aligned in the list, and are usually named with the manufacturer, size, and model number.
    Click on the Partition tab.
    Select 1-partition from the partition menu.
    Click the Options button and set to GUID
    Set the format to Mac OS Extended (Journaled)
    Give the Volume a name and click Apply.

  • I'm not able to install windows 7 in my imac 21' which has the latest OSX 10.9  It keeps saying that I need a 64bit version of win7 which i actually have but it doesn't seems to be recognize as one.

    I'm not able to install windows 7 in my imac 21' which has the latest OSX 10.9
    It keeps saying that I need a 64bit version of win7 which I actually have but it doesn't seems to be recognize.
    Can someone help me out?
    Thank you

    To my knowledge there are no official MS Windows DVDs that contain both the 32 and 64 bit versions. There is a way to make a USB thumb drive that has both bit version on it but AFAIK this can't be done on a DVD disc even with a Dual Layer DVD disc.
    For the Windows installer to function, actually boot the system to the install routine, certain files have to be on a certain area of the DVD disc. If by chance you really do have a DVD disc that contains both bit versions your Mac is only seeing the 32bit version on that disc.
    You'll need to get a Real MS DVD of just the 64bit version or download the 64bit version ISO from My Digital Life and burn it to a DVD disc.
    Pedroapple wrote:
    In fact i'm using a DVD with both 32 and 64-bit win7. But it's the only one I have. I don't want to install the newest Win 8.
    So you're saying there is no solution for this?
    Thank you so much for your response.

  • I have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    i have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Using those instructions you may also be able to select PayPal if that is allowed in your country.

  • Manage bean methods not able to call application module methods

    Hi,
    I have an ADF application where in my managed bean method needs to call AppModuleImpl methods. I use the code as below:
    public void getSummary() {
    DCBindingContainer binding = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding op = binding.getOperationBinding("getVOData");
    op.execute();
    The code works fine when I run the application in my IntegratedWeblogicServer and I am able to get the data on my .jsp pages.
    I have installed weblogic server on another machine and I need to deploy and run my application on that server. But when I try doing that, the above code is not able to call the AppModule method and I see no data on my page (Also there is no error or exceptin thrown). Seems that the ViewController project is not able to interact with the Model project.
    Is there any extra configuration to be done on the newly installed weblogic server to get this work? Or will some change in the application code help?
    Please suggest.
    Thanks and regards,
    Ansh

    Hi,
    While creating the weblogic domain, we had the following checkboxes checked:
    1. Basic weblogic server domain [wlserver_10.3]
    2. Oracle JRF [oracle_common]
    I hope this is what we need.
    Yes, I also have the adf runtime installed.

  • I am getting a pop up on my iPhone 4S asking password of my iCloud even though I feed the password but still keep on asking the same thing every second so I am not able to use my iPhone.

    I am getting a pop up on my iPhone 4S asking password of my iCloud even though I feed the password but still keep on asking the same thing every second so I am not able to use my iPhone.at various times it asks different passwords.

    Curretly, there is an iCloud blackout.  It started this morning around 2AM California time (Pacific), 5AM New York (Eastern).  A lot of people have been having issues all day, including me.  No iCloud services are online.  Even Find My iPhone is down.

  • I bought new i phone 5 3 days back, after that asked for new update which is 6.1.4, after updating my iphone i am not able to use cellular data services. I called up data provider, they says its the problem with new software update. There is no option add

    I bought new i phone 5 3 days back, after that asked for new update which is 6.1.4, after updating my iphone i am not able to use cellular data services. I called up data provider, they says its the problem with new software update. There is no option add APN. Now when i switch to safari its showing you are not subscribed for cellular data. But I am able to use data on other phone.
    Will you please help me in this regard?
    Another issue, since i bought my new iphone there is dust inside back main camera.
    Your advises are highly appreciated.

    Hey Shaiju isac,
    I'd take a look at the following article, it'll guide you though steps to you troubleshoot cellular data issues on your iPhone:
    iPhone: Troubleshooting a cellular data connection
    http://support.apple.com/kb/ts3780
    Cheers,
    David

  • After upgrading to Lion, not able to use Quicken 2007.  Get the following message: PowerPC applications are no longer supported.  Anyone has a solution?

    After upgrading to Lion, not able to use a PowerPC Application (Quicken 2007).  Any solution?

    Quicken Essentials 2010 has less features than Quciken 2007.  Keeping track of investments is one feature I need and Quicken Essentials does not include that function.  I may have to consider others financial software, such as iBank4, Money4, iFinance, and Money Well.

  • TS1398 After upgrade to iOS 6 i am not able to use wifi.

    Connected, but no wifi traffic (at home).
    After upgrade to iOS 6 i am not able to use wifi. I am connected to my home wifi but no trafic is coming through (safari, skype, twitter, app store). I have even tried recovery of my iPhone 4S using iTunes as well as using iPhone. But without effect.
    Can not connect at all (at work).
    Thank you for helpfull advice.
    Vladimir
    Please do not give me advice like:
    switch proxy to auto
    turn the flight mode on and off
    turn the iphone on and off
    release the ip
    recovery the network settings
    recovery firmware
    I have tried all these, but did not work.
    PS to apple:
    I really did not expect this kind of trouble. If I would want to waste my time "repairing my device", I would buy an android phone!!!!!!

    This helped me solve the problem:
    I have changed the security from TKIP to AES and now my wifi works fine /sofar/.
    Targat

Maybe you are looking for

  • Insertion of relative path of dtd failing with XMLType

    Hi We are using Oracle10g as the database and want to insert an xmltype data in the table. The problem is with the xml contains one relative path of the dtd file, which is existed in the local file system. Code snippet follows, <?xml version="1.0" en

  • Cherokee problem with php after upgrade

    Hello! Some weeks ago I upgraded cherokee to version 1.0.2.....! Now php files in  user directories http://localhost/~user/foo.php are processed correctly, but php files in the main server directory /srv/http give the following error message:     No

  • Osmf 1.5 and Flash builder "Burrito"

    Hello. I'm using fb "burrito" for development   (build  4.5.0.17689 - max preview). I'm trying to get into osmf but I encounter problmes while building projects. Too much "internal error build". It's me or some issue between osfm and fb burrito? I gu

  • Receive data through php without button

    Hi, This is the situation: I have an application that is displaying pictures. First I would like to display a score with each picture, so everytime a picture is being loaded I would need to get the score by posting the name of the picture through HTT

  • Migrate 11g AWM in 10g AWM (lower version compatibilities)

    Hi, I am new to Oracle OLAP AWM. I want to migrate 11g AWM in 10g AWM (lower version compatibilities) and then build the Cube in 10G database itself. Can some one please help me in this regard? Thanks in advance, CD