Skip to content

Instantly share code, notes, and snippets.

@kevindoran
Created February 1, 2013 01:03
Show Gist options
  • Select an option

  • Save kevindoran/4688260 to your computer and use it in GitHub Desktop.

Select an option

Save kevindoran/4688260 to your computer and use it in GitHub Desktop.
Menu Table JSF Composite Component
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<cc:interface>
<cc:attribute name="model" type="nz.co.kevindoran.jsfmenutable.MenuTable"/>
<cc:attribute name="updateID" />
</cc:interface>
<cc:implementation>
<table>
<ui:repeat id="repeat1" value="#{cc.attrs.model.rows}" var="row">
<tr>
<ui:repeat id="repeat2" value="#{row.contents}" var="entry">
<td>
<h:commandLink actionListener="#{cc.attrs.model.setSelected(entry)}" value="#{entry.toString()}">
<f:ajax render="#{cc.attrs.updateID}"/>
</h:commandLink>
</td>
</ui:repeat>
</tr>
</ui:repeat>
</table>
</cc:implementation>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment