>> >Hi,
>> >I have a web service, it get's data from the SQL server and displays in
[quoted text clipped - 10 lines]
>Hi Steve,
>If you have any sample script , please send to me.
OK, but, I have a fair bit of infrastructure built up in this form,
mainly for supporting user configurable preferences, and I decided to
take some of it out but leave some of it in. The stuff I have left in
-- anything related to my Globals object -- should be self
explanatory.
setTimeout method
<URL:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/setTimeout.asp
/>
--- script.js ---
var Globals = { ... stuff ... }
var oTaskPane = null;
var gfInitialized = false;
function InitTaskPane()
{
if (null == oTaskPane)
{
if (null == XDocument.View)
return;
oTaskPane = XDocument.View.Window.TaskPanes.Item(0);
}
if (oTaskPane.HTMLDocument.readyState != "complete")
{
return;
}
gfInitialized = true;
}
function GetTaskPaneWindow()
{
if (oTaskPane)
{
if (Globals.HasFullTrust)
return oTaskPane.HTMLWindow;
else
return oTaskPane.HTMLDocument.parentWindow;
}
return null;
}
// Give the click handler for the Refresh button a valid JScript name
// so that it can also be called from script.
RefreshData = function Refresh::OnClick()
{
XDocument.Query();
if (Globals.Preferences.RefreshPeriodically == "T" &&
Globals.Preferences.RefreshInterval)
GetTaskPaneWindow().StartAutoRefresh();
}
--- taskpane.htm ---
var XDocument = null;
var iRefreshTimer = null;
var fAutoRefresh = false;
function Init()
{
// Save a reference to the XDocument
object.
XDocument =
window.external.Window.XDocument;
// Set the initial state of the task
pane contents.
XDocument.Extension.InitTaskPane();
}
function StartAutoRefresh()
{
var iInterval =
XDocument.Extension.Globals.Preferences.RefreshInterval;
if (isNaN(Number(iInterval)))
return false;
if (iRefreshTimer)
clearTimeout(iRefreshTimer);
iRefreshTimer =
setTimeout("Refresh()", iInterval * 1000);
fAutoRefresh = true;
return true;
}
function StopAutoRefresh()
{
if (iRefreshTimer)
clearTimeout(iRefreshTimer);
}
function PauseAutoRefresh()
{
fAutoRefresh = false;
}
function ResumeAutoRefresh()
{
fAutoRefresh = true;
}
function Refresh()
{
if (fAutoRefresh)
XDocument.Extension.RefreshData();
}
--
Please post questions to the newsgroup; everyone benefits.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sample code subject to http://www.microsoft.com/info/cpyright.htm
sakieboy - 01 Oct 2004 13:13 GMT
Hey Steve,
I'm having a problem pushing the data back to the Web Service using InfoPath.
Getting the 'Update unable to find TableMapping['Table'] or DataTable
'Table'.' for the DataAdapter Update.
It appears (to me) that the XML that I'm attempting to pass back is not in
the format it wants. How would I check to see if something is actually being
sent back? And, how would I display it, (although, not sure if this part
will help)?
Thanks
Darryl
dwheeler@jjg.com