No, you don't use the current() function in code, just in formulas. What you
need to do is recognize where in the repeating table you are. Take a look at
this article
http://enterprise-solutions.swits.net/infopath/retrieve-field-value-same-row-rep
eating-table.htm . It might help.
---
S.Y.M. Wong-A-Ton
I cannot seem to get anything in the article to run
When I enter XDocument.UI.Alert(eventObj.Source.nodeName); - I get an
expected end of statement error.
When I try to enter
objTask = eventObj.Source.parentNode.selectSingleNode("../TaskName") I get
an expected object error.
I am just as lost as I was before - Any and all help is appreciated.
Beth
> No, you don't use the current() function in code, just in formulas. What you
> need to do is recognize where in the repeating table you are. Take a look at
[quoted text clipped - 22 lines]
> >
> > Any help is appreciated......Beth
BethB - 31 Aug 2006 15:50 GMT
I am sorry - I did not mean to sound ungrateful - I am just very frustrated.
It seems to me that it should be very easy to change the value of a field in
the current row of a repeating table without always changing the first row
instead.
> I cannot seem to get anything in the article to run
> When I enter XDocument.UI.Alert(eventObj.Source.nodeName); - I get an
[quoted text clipped - 33 lines]
> > >
> > > Any help is appreciated......Beth
S.Y.M. Wong-A-Ton - 01 Sep 2006 08:40 GMT
I understand. No worries.
Many things that "should" be easy are fairly complex to achieve in InfoPath.
The articles I've written and write try to ease some of that pain, but they
still don't provide all the answers. They are only samples of how you might
get things that seem impossible in InfoPath done. My own time is limited, so
I cannot provide free full solutions to everyone. I've got to make a living
too. :)
---
S.Y.M. Wong-A-Ton
> I am sorry - I did not mean to sound ungrateful - I am just very frustrated.
> It seems to me that it should be very easy to change the value of a field in
[quoted text clipped - 38 lines]
> > > >
> > > > Any help is appreciated......Beth
ahmedakb@googlemail.com - 27 Sep 2006 12:03 GMT
Hiya guys, I found a similar issue with this. I was attempting to
select other values in the same repeating table row using the
onAfterChange event of another field.
I used the following:
if (!e.Operation.Equals("Delete")
{
String str =
e.Source.parentNode.selectSingleNode("../myRepatingTable:Tax").text
}
This worked fine without any errors.
The onChangeEvents are called twice once for delete and then for
insert, the delete has the parentnode set to null.
Thats where we get the errors.
> I understand. No worries.
>
[quoted text clipped - 49 lines]
> > > > >
> > > > > Any help is appreciated......Beth
S.Y.M. Wong-A-Ton - 01 Sep 2006 08:30 GMT
Correct the XPath expression in the last statement and the error should be
resolved. TaskName is an attribute (as in your first post) and not an element
as you've defined it now. Add the @ sign back. And you're on the right track
trying to debug your code using alerts; not sure what's causing the error
there, though.
---
S.Y.M. Wong-A-Ton
> I cannot seem to get anything in the article to run
> When I enter XDocument.UI.Alert(eventObj.Source.nodeName); - I get an
[quoted text clipped - 33 lines]
> > >
> > > Any help is appreciated......Beth