Mojarra 2.1.5 / Java
I have two entities : i.e.
class Primary { String name; String age }
class Second { String dept; String hour }
...
In my managed bean I developed a function to generate PDF regarding my front-end prime-faces radio button (Primary or Second).
If I select in radio button the Primary option, the managed bean method will fire generatePDF() and inside the generatePDF I have :
Primary pr = new Primary();
pr.name = xxxxx;
pr.age = yyyyy;
...
...
But how can I do to re-utilize the same method generatePDF for both entities (Primary and Second ? I need to access both entity properties regarding my radio selection.
I need to instantiate the entities dynamically (Or I instantiate Primary or I intantiaty Second at a time)