invoke action pressing button,
build in action part of modalPanel DOM programmatically,
and using onComplete event show it.
yes, as you could see we are talking about show() and hide() as about client side api in all guidelines. So panels already on the page. Just use conditional rendering fro panels or for content of the panels and use a4j: action controls to load actual content and show the panel using oncomplete as elf proposed.