Thursday, 09 September 2010

The products listed above, and their associated names, icons and logos, are the intellectual property of Microsoft Corporation.

Web Gadget Forums
Creating my OWN events with Javascript
MSDN Forums: Web Gadget Development -

 

Can anyone tell me how I can create my own custom event in JavaScript and how to fire it?

 

I'm using AJAX and want to fire an event with soem data when the script gets downloading some XML from our server.

 

Nearly everything I've read about JavaScript events just shows how to handle them, not how to create and fire your own.

 

Any help is appreciated.

 

Thanks,

 

Patrick


View article..

My web gadgets stop working, and I havn't changed them
MSDN Forums: Web Gadget Development -

 

Please help.

I have made three web-gadgets for windows.live and spaces and they have been working for a while.

I have been away for a while and suddenly when I checked my gadgets - they no longer work!

 

You can add the gadget to my.live.com or spaces, but as soon as you press the install gadget button a windows live menu bar (which says "sign in") and a windows live banner and a text saying "Our Apologies" appear - thats it. No explanation - and yes I AM signed in-

 

here is a link to the page where one of them can be installed:

Leopard Safari Picture of the day

http://gallery.live.com/liveItemDetail.aspx?li=808b51ea-1d5a-4e63-b369-c3aa7abfc61b&bt=7&pl=4

 

Again, please help as I do not have a clue as to what is going on.

Thanks

Webmaster of Tours2EastAfrica


View article..

onClienClick does not work correctly after deploying
MSDN Forums: Web Gadget Development -

 

Hi everybody,

I have created a simple web form which contains a repeater. every item of the repeater has a button to delete the tiem.

 

my web form uses Resource files to globalizing the form (multiLanguage). the value of the resource string is saved in a asp:hidden control to be used later in a javascript function, so in the following code ConfirmMessage is a asp:hidden control which saves the value of the properties of the resource files.

So the value of ConfirmMessage is a confirm message from Resource files in 4 languages which will be showen when a client click on the RemoveBtn to delete an item.

 

in developing environment everything works good and i deploy it to production. within the production machine I browse to my site (http://mydomain.com) and here everything works good, I get the confirm message and when I click on Cancel it nothing happen (the item is not deleted). But the problem is when I browse to production from another machine it removes the item even when I click Cancel. it seems the javascript does not works at all. it do a reload and it seems to go in to the onClick event.

Thank you for any help.

here is my code:

asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script language="javascript" type="text/javascript">

function ShowConfirmDelete() {

var theMessage = document.getElementById('<%=ConfirmMessage.ClientID%>').value;

return confirm(theMessage);

}

script>

<asp:Repeater ID="DataList1" runat="server" DataSourceID="SqlDataSource1" >

<ItemTemplate>

asp:Label ID="itemdateLabel" runat="server" Text='<%# Eval("CreatedDate","{0:d}") %>' />

<asp:Button ID="RemoveBtn" runat="server" Text="delete"  OnClick="RemoveBtn_Click" OnClientClick="return ShowConfirmDelete();" />

ItemTemplate>

asp:Repeater>

asp:Content>


View article..

passing parameters to a web service in soap request from Web.network.Create Request
MSDN Forums: Web Gadget Development -

Hi,

I am writing a gadget in which i am making a web  network request to a web service 

i have written the code from thje examples given in SDK.

Here is the sample

function GetData(int id)

{

window.alert("It is Called");// In the code below, we are calling a web service with the following function prototype:

// public TrackingResponse GetTrackingInfo(string trackingNumber)

var url = "http://localhost/GetDataService/Service.asmx";

var aObjHeaders = new Array();

aObjHeaders["SOAPAction"] = http://tempuri.org/GetDetails;

aObjHeaders["Content-Type"] = "text/xml";

var strPostArgs = new Web.StringBuilder();

strPostArgs.append("");

strPostArgs.append(");

strPostArgs.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">");

strPostArgs.append("");

strPostArgs.append("");

strPostArgs.append("");

strPostArgs.append("id.toString()");

strPostArgs.append("");

strPostArgs.append("");

strPostArgs.append("");

strPostArgs.append("");

window.alert(strPostArgs.toString());

var r = Web.Network.createRequest( Web.Network.Type.XMLPost,url,null,responsedata,Web.Utility.Prioritizer.Priorities.Medium,strPostArgs.toString(),aObjHeaders ); // Array of headers

r.execute();

}

function responsedata(response)

{

window.alert(response.status.toString());

}

Here i have observed that the parameter that i am passing to web method is not getting passed to the service.But the response is coming from the service

please help me in solving it.

 

regards

krishna

 

 

 

 

 


View article..

Help regarding using Array in gadget
MSDN Forums: Web Gadget Development -

 

Am using multi select list box in my settings page in Gadget. I will select 3 values from the multiselect list box. After clicking OK in my settings page, i want to access the selected values in the Gadget home page. I have tried it a lot. But am not getting it.

 

Sample Code:

 

Below is written in my setting page OK event

 

function SettingsClosing(event)

{

// if user pressed the OK button

if(event.closeAction == event.Action.commit)

{

var j=0;

 var OtherClockArray=new Array();

 var ClockCityctrl=document.getElementById("cbSelectCity");

 for (i=0;i

{

 if (ClockCityctrl.options[i].selected)

 {

 OtherClockArray[j]=i;

 j++;

 if (j>2)

 {

 break;// I have used break so that more than 3 values will be omitted.

 }

 }

 }

}

}

 

The below code is what am writing(saving values in setting page)

 

System.Gadget.Settings.write("OtherClockArray", OtherClockArray);

 

 

I my Gadget Home page, i have tried to access value like this

 

var ttt=new Array();

ttt=System.Gadget.Settings.read("OtherClockArray");

document.write(ttt);

 

Now i get the value as 123

If i write

document.write(ttt[0]);

then am getting "undefined" message

 

Can any one help how to get the array values from setting page to gadget main page.
View article..

Gadget denied from gallery due to remote JS file references
MSDN Forums: Web Gadget Development -


I get the following error when I try to post my gadget to the gallery:

"The gadget.xml file should only refer to .js files that are in the package. It shouldn't refer to any remote javascript files"


However, I am absolutely certain there are no references to remote javascript files.  What is causing this?


View article..

Can't add sample gadget from SDK to my Gadget list.
MSDN Forums: Web Gadget Development -

I am following the Gadget SDK instructions to add a gadget to my live.com page using IE7.

The sample hello world was proper installed and I could use the http://localhost/Gadgets/Hello/HelloWorldGadget.xml to launch this page on my local IIS.

Next, I following the SDK instructions:

  1. Go to http://www.live.com
  2. Click on 'add stuff, and click on 'Advanced Options'
  3. Enter the url to the manifest XML for one of the sample Gadgets in the 'add Gadget or feed by url' edit box. For example, try http://localhost/Gadgets/hello/HelloWorldGadget.xml.

but this failed when I hit the "Subscribe button"  with error:

 

It trapped to line 518 of shared.live.com/.../liveframework.js


{xml.open("GET",o.url,true);}

with an access denied problem.  Can you provide some hints on what I have done wrong?

 


View article..

Getting Access Denied when installing Gadget samples
MSDN Forums: Web Gadget Development -

 

I have downloaded the samples for web gadget development on the live platform.

I have followed all the steps in the developers guide.

At the point in time where I am adding the sample xml path on my.live.com I get an access denied.

Any help/ideas?

I have never run IIS before, so I am at the very beginner level.

Thanks


View article..

problem in populating select box
MSDN Forums: Web Gadget Development - Hello everyone,

I don't know whether this is right forum, but my problem is more related to javascript so, hopefully this is the right place for this. I am trying to populate a select box using AJAX in struts which uses some javascript. I am using following code for adding options to the select box in the form:

function AddItem(Text,Value)
{
var opt = document.createElement("option");
document.getElementById("format").options.add(opt);
opt.text = Text;
opt.value = Value;

}

In JSP I have this select box as:



I have checked on google and for many users it works fine, but I am getting an error 'object required' on line - : var opt = document.createElement("option");

Can any one help me in solving problem.

Thanks
View article..

How to get element to which event is attached
MSDN Forums: Web Gadget Development -

Since events bubble up the DOM hierarchy, the window.event.srcElement doesn't always identify the element to which an event handler was assigned.  For example, let's say I have several instances of the following content in my gadget:

 

 

and then I attach an onclick event handler to each such table:

 

elTable.attachEvent("onclick", onClickControls);

 

In my onClickControls handler, I would like to know which table contains the img (or td) element that was clicked.  However, the window.event.srcElement identifies the img (or td) element that fired the event, not the table element where the event handler was attached.  The only way I found to get the table is to enumerate all elements in the document until I find the table which contains window.event.srcElement:

 

var el, elTable;

 

elTable = null;

 

for (var i = 0; i < document.all.length && ! elTable; ++i)

{

el = document.all(i);

 

if (el.id == "controls" && el.contains(window.event.srcElement))

elTable = el;

}

 

This problem is unique to gadgets, since event handlers must be added dynamically via attachEvent.  Normally you could remove the ambiguity with the following:

 

...

 

It's may not a big deal, but it seems slower (and requires additional script code) to include this kind of logic in all my event handlers to locate the element I'm interested in.  Is there a better way?


View article..

PreviousNext
Copyright 2009. Sponsored by nsquared   |  Terms Of Use  |  Privacy Statement
Content on this site is generated from the developer community and shared freely for your enjoyment and benefit. This site is run independently of Microsoft and does not express Microsoft's views in any way.