hello everyone!
i'm having trouble trying to get the value of a repeating row. what i want to do is in the repeating row, i have a check box field and when users check that field, i want to get the value of a field in the same row and copy it to another field in the same row. i'm calling my code in the On_After_Change of the check box field. Here's a simple schema:
my:a_group
my:a_group2 (repeating)
my:Number
my:override
my:aDatefield
my:anotherDatefield
So in that function. i tried
public void override_OnAfterChange(DataDOMEvent e)
{
IXMLDOMNode the_node = e.Site.selectSingleNode("my:aDatefield");
string node_value = the_node.text;
}
This does not work, it always says it doesn't exist. i searched the forums and there were plenty of discussions on this topic and i tried e.Source, but that didn't work either. i saw on one post that: "e.Site will always have a reference to the node, where as e.Source will have reference to the node or attribute whose value has changed.:
I tried changing to the whole Xpath but that doesn't work either. I know that you can just go straight to the node of the current row in the repeating section by just specifying the field name ("my:aDatefield") instead of the whole xpath, but its not working. I also tried ("//my:aDatefield") and other numerous combinations but I'm doing something wrong in my xpath.
I can get the value by using this:
string strRowNumber = e.Site.nextSibling.nextSibling.nextSibling.nextSibling.text;
But I know you should never do this because if you add a field to the repeating group in the schema, this would be referencing the wrong field.
Can someone please help me on this? I know this subject has been brought up alot, but i just can't seem to figure it out. I'm assuming its the xpath! Anyhow, any comments are greatly appreciated!
thanks in advance,
================
DOH! I can just use rules behind my field to set the value of one field to another in the repeating group. I can't believe I did not think of this. I've been doing this all along for other stuff, but I don't know why I totally forgot. Anyhow, if anyone does know the xpath just in case i need it for some odd reason, that would be great! DOH!!!! on me!