Thank you thank you thank you for responding!!! Many people in my organization will be very pleased if I can pull this off by Monday, so please pardon my seeming panic... ;)
I get the fact that I need to use the OnAfterChange event in view A... I also get the fact that I'll need to append stuff to the table using the events you mention below. What remains unclear to me at this point is how to get the code I write in View A to actually create/remove the nodes in View B.
Specifically, do I even need to "switch" views to create/remove the nodes in View B based on the checkbox values in View A? Where would I hang the actual "switch" then, since I can't put it on the onAfterChange event...
Or, have I just totally entered the world of the DOM/XPATH and need to handle this by manipulating the XML behind the scenes rather than worrying about the views?
quote:
Originally posted by Greg Collins
If I understand what you are asking, you want to have the user check a box in View A, and when they do, an extra row is added to a table in View B. When they clear the check box, the row is deleted.
If that is accurate, then you should be using the OnAfterChange event handler for the check box. If the value is TRUE then you would use code to insert the row. If it is FALSE you would use code to remove the row.
To add a row, you would A) create a new row node, or B) clone an existing row node and clear any values in it, and then append it to the end or insert it somewhere in the middle of the table node.
To remove the row, you would select it and use removeChild().
If you are not familiar with this kind of coding, I would suggest doing a search for "cloneNode" "appendChild", "insertBefore", and "removeChild". There are plenty of online tutorials for these.
Greg Collins [InfoPath MVP]
InfoPath Dev