You can use a4j:commandButton and open modal panel by oncomplete.
thanks, it works!
can i ask why? and why the other buttton doesnt work?
That's because model panel doesn't keep its opened state across requests and h:commandButton causes full page reloading, so that panel closes. Even if state was kept the visual experience won't be good, because panel will blink. a4j:commandButton doesn't reload the whole page, it does partial page content update.
great, thanks for the explanation!