<%
/**
 * Created by The eXo Platform SARL
 * Author : Dang Van Minh
 *          minhdv@exoplatform.com
 * Oct 17, 2006
 * 9:32:56 AM 
 */
%>
<div id="$uicomponent.id" class="$uicomponent.id">
  <table class="UIGrid">	  
	  <thead>
	    <tr>
	      <th><%=_ctx.appRes("UITreeList.header.name")%></th>
		    <th><%=_ctx.appRes("UITreeList.header.action")%></th>
	    </tr>
	  </thead>
	  <tbody>
      <%
        def nodes = uicomponent.getSelectableNodes() ;
        def rowClass = "OddRow" ;
		    boolean even = true ;
		    if(nodes.size() > 0) {
			    for(node in nodes) {
				      if(even) {
				      	rowClass = "EvenRow" ;  
				      } else {
				      	rowClass =  "OddRow" ; 
				      }
				      even = !even ;
	      %>
				      <tr class="$rowClass">
				        <%
			            String path = node.getPath();
			            String nodeName = path.substring(path.lastIndexOf("/") + 1, path.length());
                %>
				        <td class="Text">$nodeName</td>
				        <td>
			              <a href="<%=uicomponent.event("Select", node.getPath())%>">
			                <div class="Select16x16Icon" style="margin:auto"><%=_ctx.appRes("UITreeList.action")%></div>
			              </a>
				        </td>
				      </tr>
			<%
					}
		    } else {
		  %>
		  		<tr class="EvenRow">
		  			<td colspan="2" style="align:center;"><%=_ctx.appRes("UITreeList.info.child-not-found")%></td>
		  		</tr>
		  <%  	
		    }
			%>
    </tbody>
  </table>
  
  <% if (uicomponent.getUIPageIterator().getAvailablePage() > 1) { %>
  <div style="margin:1px 0px 5px 0px;">
    <%_ctx.renderUIComponent(uicomponent.getUIPageIterator())%>
  </div>
  <% } %>
</div>
<div class="ClearLeft"><span></span></div>