Clicking a button in a repeating table -- the context for the button is the row itself.
So if you have
group1
group2
field1
etc.
and you have a button in the table row... when you click the button, your context (eventObj.Site / e.Site) is group2.
Hope that helps.

Signature
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com
Sorry - I gave you the wrong information. Buttons have a Source, but not a Site.
In your OnClick event handler, you can try this:
JSCRIPT:
XDocument.UI.Alert(eventObj.Source.nodeName);
C#:
thisXDocument.UI.Alert(e.Source.nodeName);

Signature
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com
Clicking a button in a repeating table -- the context for the button is the row itself.
So if you have
group1
group2
field1
etc.
and you have a button in the table row... when you click the button, your context (eventObj.Site / e.Site) is group2.
Hope that helps.

Signature
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com
"BFSmith" <BFSmith@discussions.microsoft.com> wrote in message news:18F89042-B57A-42BA-BA7C-2CDACA19BA31@microsoft.com...
I have a repeating table with a button in it...how can I find the row
position that contains the button using OnAfterChange? Or a combination of
Rules/Code? There may have been rows that were deleted prior to using the
button. The namespace for the repeating table is the tblRADetail from:
/dfs:myFields/dfs:dataFields/d:tblRAHeader/d:tblRADetail
Also-I may need to <press> the button more than once over the life of the
form.
BFSmith - 23 Mar 2006 20:28 GMT
tnx - but - that gives me: "d:tblRADetail" - not the row position
I'm fiddling with writing the row position into a Support 2ndairy ds ...like
you showed as a resource file in a previous example...using:
count(../preceding-sibling::d:tblRADetail/@Piece) + 1
to set a row position in a field seems to work....havent connected the
2ndairy ds into my code yet tho...
I wish there was a property of eventObj that brought back the row # of the
repeating group...that would be a nice feature
> Sorry - I gave you the wrong information. Buttons have a Source, but not a Site.
>
[quoted text clipped - 18 lines]
>
> Hope that helps.
BFSmith - 23 Mar 2006 21:49 GMT
hmmm...Greg-I've got the proper row position stored in /Support/RowPosition
but am having trouble retrieving it from code...
I think I have a namespace issue....syntax must be different than getting
data from ado data fields
> tnx - but - that gives me: "d:tblRADetail" - not the row position
>
[quoted text clipped - 31 lines]
> >
> > Hope that helps.
BFSmith - 24 Mar 2006 15:36 GMT
got it using :
//Get the RowPosition out of the Suupport.xml resource file...written to by
a rule on the button
var dat0 = XDocument.DataObjects("Support").DOM;
iRow = dat0.selectSingleNode("//RowPosition").text;
> hmmm...Greg-I've got the proper row position stored in /Support/RowPosition
> but am having trouble retrieving it from code...
[quoted text clipped - 37 lines]
> > >
> > > Hope that helps.