Is there a way to know when matching is complete after using the rematch method?
We keep running into controls that do not automatically rematch when they are created or destroyed. To fix the matching, we use the rematch method. However, there seems to be know way of knowing when the runtime has stopped trying to match the control. We end up putting pauses of seemingly arbitray length immidiately after each rematch call.
I know matching is never truly complete. An event could cause a control to rematch. It seems though at some point, the runtime stops trying to match a control after using the rematch method. It does not try to rematch infinitely.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
There really isn't an event that that tells you matching is complete. When calling Rematch, assuming the control does not have a lot of children (like an entire page or an HTML table), the process should be quick. You can use a short wait for create afterwards. You may want to examine the match rules you are using to see if they play a role in the matching not working as expected. Oftentimes, a text match rule may not have detected that the text has changed preventing your control from matching automatically.
We often can't use WaitForCreate or a destroyed event because the control could be in either state.
We could do a WaitForCreate with a timeout and assume that if it times out that the control was destroyed. However, this creates an unnecessary delay potentially. The fastest way to know the controls state would be to capture a "rematch completed" event if one exists.
If you have controls that do not behave as expected you should open a SR and report the issue. Firing an event when matching is complete would be unnecessarily noisy, unfortunately. You may be able to find another control which exists in the hierarchy above your problem control that behaves properly. If so, move that control under it in the xml.