So I'm trying to find the best approach to solve the following problem.
I have the following pages:
1.insert.xhtml(Where I have a form to register a client)
2.find.xhtml(Where I have a table for the registered clients, where I can edit and exclude them)
In the find.xhtml page I have a context menu with the edit option, if I click on it, it'll open a <p:dialog>
with the same insert.xhtml registration form, except for the submit button that have a different name and action-listener.
I also have other registrations that needs a client reference on it, ex.: registering a car sell to a registered client. The way I select an already registered client to add it to the sell form is by calling a popup with the same code in the find.xhtml table and select a client there, except this table have a button on its footer called select.
So what I'm asking is a way to reuse those forms/table codes being able to add a few components on them as needed. Is there a way to do it?
EDIT: Just like a template
EDIT2: Nevermind, I just solved it by using <ui:decorate>
.