Hi Xiaomu and welcome to the forum!
I think you should be able to do this with Rules, but code might make it easier. The only problem I see with this is that since you will be dynamically changing the data source that the second and third drop-downs populate from, then the drop-downs on previous rows will show bogus data since their values are no longer in the secondary DOM.
I can understand wanting to only pull down the necessary information to gain performance, but the overhead of the extra web service calls with every drop-down selection might not be what you're looking for. The method I describe below will mean that every time the user selects a value from the first drop-down the form will freeze for about a second before returning control to the user. This one second freeze will be perceived by the user as very bad performance, even if the overall perf is better than downloading everything you need at once.
I don't know your exact scenario, but I would highly recommend trying to download all the data that you need when the form opens and then just using dynamic filters like any old cascading drop-down. With this method, you could also use InfoPath 2007's cached secondary data source feature.
Here's a link on the traditional cascading drop-downs: http://www.infopathdev.com/search/SearchResults.aspx?q=cascading+drop-down&a=1
So, if you really want to do this, here's how:
- Set the rule on the first drop-down to fill the value of the queryField in the web service data connection to its value.
- Query the web service
- Make sure the second drop-down is pointed and filtered at the web service data connection.
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge