Hi,
I have a repeating table with an "on change" event for one of the columns. When a value in this column changes, I need to update the value of another field in the same row. So far, I have been unable to get the current row within the "on change" event handler. Here's some more information that may be helpful in coming up with a solution:
- Although I used the terms row and field, let me be clear that the datasource is actually an XmlDocument returned from a web service, not a database. The various "fields" displayed in a row of the repeating table are various attributes on the same node.
- The solution, whatever it is, must work in a browser-enabled form. The InfoPath client will not be used, only browsers.
- I don't think using a "rule" will work since I need the logic to happen whenever the value in the field has changed, regardless of what the actual value is. Also, the logic must not happen if the value hasn't changed. Rules don't appear to allow for this.
- The "sender" object for the on change event handler is an attribute - the one whose change is triggering the event. Unfortunately, I can't seem to get a reference to the object for which it is an attribute. (The value of e.OldParent is null. Using a relative xpath such as "./@otherattribute" or "../@otherattribute" returns a null reference. And when I tried using an absolute xpath with the current() function in it, such as "/dfs:myfields/dfs:datafields/.../record[@alias = current()/@alias]", I get an error saying that an XsltReference is needed due to an unknown function. In other words, it doesn't recognize the current() function.
I've been trying to get this working for a while and I'm getting frustrated. This should be fairly easy. It is a show-stopper on a project with high visibility in the company. Please help! Thanks in advance!
I have a repeating table with an "on change" event for one of the columns. When a value in this column changes, I need to update the value of another field in the same row. So far, I have been unable to get the current row within the "on change" event handler. Here's some more information that may be helpful in coming up with a solution:
- Although I used the terms row and field, let me be clear that the datasource is actually an XmlDocument returned from a web service, not a database. The various "fields" displayed in a row of the repeating table are various attributes on the same node.
- The solution, whatever it is, must work in a browser-enabled form. The InfoPath client will not be used, only browsers.
- I don't think using a "rule" will work since I need the logic to happen whenever the value in the field has changed, regardless of what the actual value is. Also, the logic must not happen if the value hasn't changed. Rules don't appear to allow for this.
- The "sender" object for the on change event handler is an attribute - the one whose change is triggering the event. Unfortunately, I can't seem to get a reference to the object for which it is an attribute. (The value of e.OldParent is null. Using a relative xpath such as "./@otherattribute" or "../@otherattribute" returns a null reference. And when I tried using an absolute xpath with the current() function in it, such as "/dfs:myfields/dfs:datafields/.../record[@alias = current()/@alias]", I get an error saying that an XsltReference is needed due to an unknown function. In other words, it doesn't recognize the current() function.
I've been trying to get this working for a while and I'm getting frustrated. This should be fairly easy. It is a show-stopper on a project with high visibility in the company. Please help! Thanks in advance!