I created 2 components a custom richfaces button and a custom richfaces dialog component. The dialog component needs to have 2 buttons (1 "cancel" and 1 "ok" button). Now I can easily add the buttons like:
<customRich:dialog> <customRich:button text="cancel"/> <customRich:button text="ok"/> </customRich:dialog>
You can create custom Facelets tag including both buttons.