The context for the button is the row of the table... meaning, if you have a data source that looks like this:
Group1
Group2
field1
And a repeating table that looks like this
[button][text box]
[button][text box]
[button][text box]
Clicking on the button will put our starting point for selection in Group2.
It sounds like you already had that part figured out, but I added it for the sake of others reading this thread.
As for why the second statement doesn't work, I'm not sure. I wrote the same code, and it worked for me:
function CTRL3_5::OnClick(eventObj)
{
XDocument.UI.Alert(eventObj.Source.selectSingleNode("my:field1").text);
}
Greg Collins [InfoPath MVP]
InfoPathDev