Multiple JSF's in TabPanel
dolos Sep 9, 2010 1:35 PMHi everybody.
I've been doing some pages to edit tables from a database. The structure of that pages is very simple, a dataTable with the records from the DB and actionlinks to edit, view and delete each record. Also I have a button to add a new record. The edit, delete, view and add operations uses a modal panel to show some data and, if needed, capture something. So my pages follow a "template" like this:
<f:view> <html> <head> Some tags... </head> <body> <rich:panel header="Panel"> <h:form> <a4j:commandLink> <h:graphicImage style="border: 0px" value="/resources/Iconos/add.png"/> </a4j:commandLink> <rich:dataTable> Data Columns and Action column with actionlinks to edit, view and delete </rich:dataTable> </h:form> </rich:panel> <a4j:keepAlive beanName="Bean"/> <rich:modalPanel autosized="true" id="modalDelete" minWidth="250"> <h:form> Confirm message to delete and action links (OK or NO) </h:form> </rich:modalPanel> <rich:modalPanel autosized="true" id="modalEdit"> <h:form> Fields to edit data... </h:form> </rich:modalPanel> <rich:modalPanel autosized="true" id="modalView" minWidth="250"> <h:form> Fields to show data... </h:form> </rich:modalPanel> </body> </html> </f:view>
Everything works great! But now I want to do something a little more complex. I need to edit a table with relationships to other tables, and edit that relationships too, so I have a Tab panel with a tab to general data from the main table, and tabs to edit each other tables. I'm tryng to edit 6 diferent tables so I think a single JSF will be too big, so I do a JSF for each secondary table and a JSF with the tabpanel and the fields needed to the main table. The problem is I don't know how to organize the forms in this pages. Now I have a form that contains all the tabpanel in the main page, and in the secondary pages i have changed the above template to use a4j:form instead of h:form but I'm not sure it is the best way to do it. It works in FireFox and Chrome, but I get errors in Internet Explorer so my question is What is the best way to organize the forms in this case? Can I have multiple forms in a TabPanel?