row position

B

BFSmith

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.
 
G

Greg Collins [InfoPath MVP]

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.

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.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.
 
G

Greg Collins [InfoPath MVP]

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);

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message 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.

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.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.
 
B

BFSmith

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
 
B

BFSmith

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

BFSmith said:
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

Greg Collins said:
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);

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message 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.

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.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.
 
B

BFSmith

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;

BFSmith said:
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

BFSmith said:
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

Greg Collins said:
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);

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message 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.

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.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.
 

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