I am trying to automatically reRender a datatable when user click on Ok button on a modal panel. For whatever reason it isn't refreshing. What am I doing wrong here? Any help will be greatly appreciated.
I'm not surprised. Despite being on the same view definition, I'd expect the modal panel to pretty much behave like an independent view.
Since the modal panel blocks the background view (that is, after the definition of a modal dialog), you should expect that the background view is going to remain static.
The solution to that is probably going to be that you trigger the background reRender events as part of the ModalPanel's dismissal operation. Roughly speaking, that means an "onclose rerender" operation.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.