Capturing a Node Value Change

M

Michael Morse

Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
F

Franck Dauché

Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché
 
M

Michael Morse

Thanks Frank,

But can this also be done with JScript and not managed code?

Franck Dauché said:
Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


Michael Morse said:
Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
F

Franck Dauché

Yes, you can use:

function msoxd_my_myRootName::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo)
{
return;
}
//Your code here
}

Hope that it helps. If my post was useful to you, don't hesitate to rate it.

Regards,

Franck Dauché


Michael Morse said:
Thanks Frank,

But can this also be done with JScript and not managed code?

Franck Dauché said:
Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


Michael Morse said:
Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
M

Michael Morse

Frank,

That's awesome and helps alot!.. but where is this documented? It makes me
wonder what other events I could listen for.

Because by looking in the object browser I don't see this event

Franck Dauché said:
Yes, you can use:

function msoxd_my_myRootName::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo)
{
return;
}
//Your code here
}

Hope that it helps. If my post was useful to you, don't hesitate to rate it.

Regards,

Franck Dauché


Michael Morse said:
Thanks Frank,

But can this also be done with JScript and not managed code?

Franck Dauché said:
Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


:

Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
F

Franck Dauché

Hi Michael,

Glad I could help....You are rigth, there is a lack of JScript snippets, but
you can find C# out there. There you can usually figure out the JScript
equivalent...by trial and error at least.

Good luck with your developments.

Regards,

Franck M. Dauché


Michael Morse said:
Frank,

That's awesome and helps alot!.. but where is this documented? It makes me
wonder what other events I could listen for.

Because by looking in the object browser I don't see this event

Franck Dauché said:
Yes, you can use:

function msoxd_my_myRootName::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo)
{
return;
}
//Your code here
}

Hope that it helps. If my post was useful to you, don't hesitate to rate it.

Regards,

Franck Dauché


Michael Morse said:
Thanks Frank,

But can this also be done with JScript and not managed code?

:

Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


:

Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
M

Michael Morse

Franck,

Finally got your name right I see, sorry!

Hey, I 've gotten that event to fire ofcourse but how can I tell what node
cause the event. I specifically need it's XPath. When I try
eventObj.Source.nodeName or eventObj.Source.Site.nodeName i'm not seeing
anything to useful yet.

Is there a way I can find out which node caused the event?

Franck Dauché said:
Hi Michael,

Glad I could help....You are rigth, there is a lack of JScript snippets, but
you can find C# out there. There you can usually figure out the JScript
equivalent...by trial and error at least.

Good luck with your developments.

Regards,

Franck M. Dauché


Michael Morse said:
Frank,

That's awesome and helps alot!.. but where is this documented? It makes me
wonder what other events I could listen for.

Because by looking in the object browser I don't see this event

Franck Dauché said:
Yes, you can use:

function msoxd_my_myRootName::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo)
{
return;
}
//Your code here
}

Hope that it helps. If my post was useful to you, don't hesitate to rate it.

Regards,

Franck Dauché


:

Thanks Frank,

But can this also be done with JScript and not managed code?

:

Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


:

Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
F

Franck Dauché

Hi Michael,

You won't be able to access the full XPath from just on property. In fact
you need to build your XPath.
From your first node: eventObj.Source, you can get the name through
nodeName. Then you have to use node.parentNode to go back one level in your
schema and get the name of that node that you append to the previous one, all
the way back to the root.

Does it make sense?

Hope that it helps.

Regards,

Franck Dauché

Michael Morse said:
Franck,

Finally got your name right I see, sorry!

Hey, I 've gotten that event to fire ofcourse but how can I tell what node
cause the event. I specifically need it's XPath. When I try
eventObj.Source.nodeName or eventObj.Source.Site.nodeName i'm not seeing
anything to useful yet.

Is there a way I can find out which node caused the event?

Franck Dauché said:
Hi Michael,

Glad I could help....You are rigth, there is a lack of JScript snippets, but
you can find C# out there. There you can usually figure out the JScript
equivalent...by trial and error at least.

Good luck with your developments.

Regards,

Franck M. Dauché


Michael Morse said:
Frank,

That's awesome and helps alot!.. but where is this documented? It makes me
wonder what other events I could listen for.

Because by looking in the object browser I don't see this event

:

Yes, you can use:

function msoxd_my_myRootName::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo)
{
return;
}
//Your code here
}

Hope that it helps. If my post was useful to you, don't hesitate to rate it.

Regards,

Franck Dauché


:

Thanks Frank,

But can this also be done with JScript and not managed code?

:

Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


:

Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
M

Michael Morse

I keep getting the value #text when I do
XDocument.UI.Alert(eventObj.Source.nodeName);

Am I doing something wrong?

Franck Dauché said:
Hi Michael,

You won't be able to access the full XPath from just on property. In fact
you need to build your XPath.
From your first node: eventObj.Source, you can get the name through
nodeName. Then you have to use node.parentNode to go back one level in your
schema and get the name of that node that you append to the previous one, all
the way back to the root.

Does it make sense?

Hope that it helps.

Regards,

Franck Dauché

Michael Morse said:
Franck,

Finally got your name right I see, sorry!

Hey, I 've gotten that event to fire ofcourse but how can I tell what node
cause the event. I specifically need it's XPath. When I try
eventObj.Source.nodeName or eventObj.Source.Site.nodeName i'm not seeing
anything to useful yet.

Is there a way I can find out which node caused the event?

Franck Dauché said:
Hi Michael,

Glad I could help....You are rigth, there is a lack of JScript snippets, but
you can find C# out there. There you can usually figure out the JScript
equivalent...by trial and error at least.

Good luck with your developments.

Regards,

Franck M. Dauché


:

Frank,

That's awesome and helps alot!.. but where is this documented? It makes me
wonder what other events I could listen for.

Because by looking in the object browser I don't see this event

:

Yes, you can use:

function msoxd_my_myRootName::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo)
{
return;
}
//Your code here
}

Hope that it helps. If my post was useful to you, don't hesitate to rate it.

Regards,

Franck Dauché


:

Thanks Frank,

But can this also be done with JScript and not managed code?

:

Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


:

Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
F

Franck Dauché

Hi Michael,

I was thinking in terms of C#. Try to use:
var node = eventObj.Parent;
XDocument.UI.Alert(node.nodeName);

Franck

Michael Morse said:
I keep getting the value #text when I do
XDocument.UI.Alert(eventObj.Source.nodeName);

Am I doing something wrong?

Franck Dauché said:
Hi Michael,

You won't be able to access the full XPath from just on property. In fact
you need to build your XPath.
From your first node: eventObj.Source, you can get the name through
nodeName. Then you have to use node.parentNode to go back one level in your
schema and get the name of that node that you append to the previous one, all
the way back to the root.

Does it make sense?

Hope that it helps.

Regards,

Franck Dauché

Michael Morse said:
Franck,

Finally got your name right I see, sorry!

Hey, I 've gotten that event to fire ofcourse but how can I tell what node
cause the event. I specifically need it's XPath. When I try
eventObj.Source.nodeName or eventObj.Source.Site.nodeName i'm not seeing
anything to useful yet.

Is there a way I can find out which node caused the event?

:

Hi Michael,

Glad I could help....You are rigth, there is a lack of JScript snippets, but
you can find C# out there. There you can usually figure out the JScript
equivalent...by trial and error at least.

Good luck with your developments.

Regards,

Franck M. Dauché


:

Frank,

That's awesome and helps alot!.. but where is this documented? It makes me
wonder what other events I could listen for.

Because by looking in the object browser I don't see this event

:

Yes, you can use:

function msoxd_my_myRootName::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo)
{
return;
}
//Your code here
}

Hope that it helps. If my post was useful to you, don't hesitate to rate it.

Regards,

Franck Dauché


:

Thanks Frank,

But can this also be done with JScript and not managed code?

:

Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


:

Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 
M

Michael Morse

JJJJJJJJJJAAAAAAAAAAACCCCCCCCCCCCCCKKKKKKKKKK POT!

Franck Dauché said:
Hi Michael,

I was thinking in terms of C#. Try to use:
var node = eventObj.Parent;
XDocument.UI.Alert(node.nodeName);

Franck

Michael Morse said:
I keep getting the value #text when I do
XDocument.UI.Alert(eventObj.Source.nodeName);

Am I doing something wrong?

Franck Dauché said:
Hi Michael,

You won't be able to access the full XPath from just on property. In fact
you need to build your XPath.
From your first node: eventObj.Source, you can get the name through
nodeName. Then you have to use node.parentNode to go back one level in your
schema and get the name of that node that you append to the previous one, all
the way back to the root.

Does it make sense?

Hope that it helps.

Regards,

Franck Dauché

:

Franck,

Finally got your name right I see, sorry!

Hey, I 've gotten that event to fire ofcourse but how can I tell what node
cause the event. I specifically need it's XPath. When I try
eventObj.Source.nodeName or eventObj.Source.Site.nodeName i'm not seeing
anything to useful yet.

Is there a way I can find out which node caused the event?

:

Hi Michael,

Glad I could help....You are rigth, there is a lack of JScript snippets, but
you can find C# out there. There you can usually figure out the JScript
equivalent...by trial and error at least.

Good luck with your developments.

Regards,

Franck M. Dauché


:

Frank,

That's awesome and helps alot!.. but where is this documented? It makes me
wonder what other events I could listen for.

Because by looking in the object browser I don't see this event

:

Yes, you can use:

function msoxd_my_myRootName::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo)
{
return;
}
//Your code here
}

Hope that it helps. If my post was useful to you, don't hesitate to rate it.

Regards,

Franck Dauché


:

Thanks Frank,

But can this also be done with JScript and not managed code?

:

Hi Michael,

You can catch the event at the root level:

[InfoPathEventHandler(MatchPath="/my:MyRootName",
EventType=InfoPathEventType.OnAfterChange)]
public void OnAfterChange(DataDOMEvent e)
{
\\Your code here....
}

Hope that it helps.

Regards,

Franck Dauché


:

Hi

I developing an application using InfoPath but i'm noticing that InfoPath
does not raise an event when the underlying XML is changed.

Ofcourse, I can write an event handler for each node but is there a way to
capture a "node changed event" on a more global level? Possibly passing in
as a variable something similar to the DataDOMEvent object?

Any help on how I can capture this information would be very useful

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top