About Me

I am a Software Engineer presently working in Microsoft as vendor.The main aim of this blog is to Share my knowledge in Sharepoint,AZURE and Silverlight.

Friday, 6 March 2009

getting current node value in a dynamic section of infopath.

Hi ,

came back to blog some thing.
using this technique we can copy the current values and paste to the new section in a check box event.such as copy the same as above.

last week I had an issue how to get the current node value in a repeating section on firing a dropdown event.

for example if we have a text box value and a drop downs in a repeating section. as in below image.


In this example ResourceName is the dropdown and groupname is the textbox and in the change event of the dropdown we have to get groupname value.if we are doing with only one section then no need of doing all the below explaination we can use direct xpath.

But if we have same Resource names in different groups then we have to get the group name and use that group to locate the resource and fill the dependencies.

so here is the line i used to get the groupName Value

e.Site.SelectSingleNode("../../../@my:DisplayName", this.NamespaceManager).Value

here "e" is the event passed by dropdown and give the xpath value as shown above this gives the country value and we can get easily state value by using e.NewValue

No comments: