PostgreSQL 8.4
NetBeans 6.8
JPA
GlassFish
Hi
I have a data model with categories and items - with a 1:M relationship. Each category can have M items. I have generated the basic crud for the same - entity bean and session bean.
As for the UI, I am trying to build a AccordionPanel with each tab representing category and upon expanding the tab the items related to that category would be displayed in a dataTable. I looked at the AccordionPanel documentation there does not seem to be any way to bind the tab text to a backing bean. Has anyone tried this and found how it can be done? I am sure Accordion Panel can be dynamically generated.
Additionally - I am also trying to see if I can bind the the id attribute of the tab to the category code (which is unique) from the category table (bean) and then inherit it to filter the items in the nested dataTable.
Any pointers to documentation or an example for this would be appreciated.
The UI Node tree I see would be something like this
Code: Select all
<h:form>
<p:accordionPanel id="catalog">
<!-- tabs are databound to rows in the category table -->
<p:tab id="<databound:category_code>" title="<databound:category_name>">
<!-- for each category in the line above grab the category code and filter the rows in the dataTable below -->
<p:dataTable value="#productController.items" var="product" rows="10" paginator="true">
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListProductTitle_name}"/>
</f:facet>
<h:outputText value="#{product.name}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListProductTitle_description}"/>
</f:facet>
<h:outputText value="#{product.description}"/>
</p:column>
</p:dataTable>
</p:tab>
</p:accordionPanel>
</h:form>