Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / October 2004

Tip: Looking for answers? Try searching our database.

InfoPathEventHandler

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Li - 13 Oct 2004 17:02 GMT
Hi

When I load infopath, I copy data to infopath and it invokes infopathevent.

Can I set some attribute let it not invoke infopathevent?

Thanks
Greg Collins [MVP] - 15 Oct 2004 23:49 GMT
Which event are you trying to prevent?

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

Hi

When I load infopath, I copy data to infopath and it invokes infopathevent.

Can I set some attribute let it not invoke infopathevent?

Thanks
Li - 16 Oct 2004 00:20 GMT
OnAfterChange, because it takes much time when loading.

Thanks

Which event are you trying to prevent?

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

Hi

When I load infopath, I copy data to infopath and it invokes infopathevent.

Can I set some attribute let it not invoke infopathevent?

Thanks
Greg Collins [MVP] - 22 Oct 2004 19:39 GMT
During the OnLoad event, the View object is null. You can check for this to prevent any other event from running during the OnLoad event.

The following example will prevent the OnAfterChange event for my:field1 from being processed during the OnLoad event (notice the addition of the check for (null == XDocument.View):

function XDocument::OnLoad(eventObj)
{
   XDocument.DOM.selectSingleNode("//my:field1").text = "Some Value";
}

function msoxd_my_field1::OnAfterChange(eventObj)
{
   if(eventObj.IsUndoRedo || null == XDocument.View)
       return;

   XDocument.UI.Alert("OnAfterChange Event Processed");
}

Hope this helps!

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

OnAfterChange, because it takes much time when loading.

Thanks

Which event are you trying to prevent?

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

"Li" <Li@Li.com> wrote in message
news:#ifTc4TsEHA.904@TK2MSFTNGP11.phx.gbl...
Hi

When I load infopath, I copy data to infopath and it invokes infopathevent.

Can I set some attribute let it not invoke infopathevent?

Thanks

Li - 26 Oct 2004 14:51 GMT
I already prevent these events running during the OnLoad, but still very
slow.
When I deleted all these events it much faster. I used C# not javascript.
Is it code which make infopath so slow?

Thank you for your help.

During the OnLoad event, the View object is null. You can check for this to
prevent any other event from running during the OnLoad event.

The following example will prevent the OnAfterChange event for my:field1
from being processed during the OnLoad event (notice the addition of the
check for (null == XDocument.View):

function XDocument::OnLoad(eventObj)
{
   XDocument.DOM.selectSingleNode("//my:field1").text = "Some Value";
}

function msoxd_my_field1::OnAfterChange(eventObj)
{
   if(eventObj.IsUndoRedo || null == XDocument.View)
       return;

   XDocument.UI.Alert("OnAfterChange Event Processed");
}

Hope this helps!

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

OnAfterChange, because it takes much time when loading.

Thanks

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
news:uvCpKlwsEHA.1720@TK2MSFTNGP14.phx.gbl...
Which event are you trying to prevent?

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

Hi

When I load infopath, I copy data to infopath and it invokes infopathevent.

Can I set some attribute let it not invoke infopathevent?

Thanks
Greg Collins [MVP] - 27 Oct 2004 23:02 GMT
It depends on what you are doing in your code. If you are making numerous DOM operations then that might be what is slowing you down. If you are loading a massive XML file or massive number of rows from a database, that will slow you down.

You need to start commenting things out one by one to find out what the problem is.

You should also look into using the Disable/EnableAutoUpdate() methods if you are doing numerous DOM operations in the OnLoad event handler.

This is what debugging is all about--cutting things out and putting them back in until you find out what's going on.
Good luck!

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

I already prevent these events running during the OnLoad, but still very
slow.
When I deleted all these events it much faster. I used C# not javascript.
Is it code which make infopath so slow?

Thank you for your help.

During the OnLoad event, the View object is null. You can check for this to
prevent any other event from running during the OnLoad event.

The following example will prevent the OnAfterChange event for my:field1
from being processed during the OnLoad event (notice the addition of the
check for (null == XDocument.View):

function XDocument::OnLoad(eventObj)
{
   XDocument.DOM.selectSingleNode("//my:field1").text = "Some Value";
}

function msoxd_my_field1::OnAfterChange(eventObj)
{
   if(eventObj.IsUndoRedo || null == XDocument.View)
       return;

   XDocument.UI.Alert("OnAfterChange Event Processed");
}

Hope this helps!

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

"Li" <Li@Li.com> wrote in message
news:ur7QV2wsEHA.3156@TK2MSFTNGP12.phx.gbl...
OnAfterChange, because it takes much time when loading.

Thanks

Which event are you trying to prevent?

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

"Li" <Li@Li.com> wrote in message
news:#ifTc4TsEHA.904@TK2MSFTNGP11.phx.gbl...
Hi

When I load infopath, I copy data to infopath and it invokes infopathevent.

Can I set some attribute let it not invoke infopathevent?

Thanks

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.