<div class="UIForm FormLayout FormScrollLayout"> 
  <% 
    uiform.begin() 
  %>
  
  <%/* start render action*/%>
  <% if (uiform.isShowActionsOnTop()) {
            uiform.processRenderAction()
         }
  %>
    <%/* end render action*/%>   
  
  <div class="HorizontalLayout">    
   <table class="UIFormGrid">
      <tr>
        <td class="FieldLabel"><label for="title">Title</label></td>
        <td class="FieldComponent">
        <%
          String[] fieldTitle = ["jcrPath=/node/exo:title", "options=noSanitization", "validate=empty"] ;
          uicomponent.addTextField("title", fieldTitle) ;
        %>
        </td>
      </tr>  

      <tr>
        <td class="FieldLabel"><label for="name">Name</label></td>
        <td class="FieldComponent">
        <%
          String[] fieldName = ["jcrPath=/node", "options=noSanitization", "mixintype=mix:votable,mix:commentable,mix:i18n,mix:versionable", "editable=if-null", "validate=empty,name"] ;
          uicomponent.addTextField("name", fieldName) ; 
        %>        
          <script type="text/javascript">
          titleField = document.getElementById("title");
          titleField.onchange = function() { eXo.ecm.SELocalization.cleanName(this.value, "name"); } ;
          </script>
        </td>
      </tr>
      
      <tr>
        <td class="FieldLabel"><label for="content-lang">Language</label></td>
        <td class="FieldComponent">
        <%
          String lang = org.exoplatform.portal.webui.util.Util.getPortalRequestContext().getLocale().toString();
          String[] fieldLang = ["jcrPath=/node/exo:language", "script=ecm-explorer/widget/FillSelectBoxWithLanguage.groovy", lang] ;
          uicomponent.addSelectBoxField("content-lang", fieldLang) ;
        %>
        </td>
      </tr>  

      <tr>
        <td class="FieldLabel"><label for="location">Location</label></td>
        <td class="FieldComponent">
        <%
          String[] fieldLocation = ["jcrPath=/node/exo:location", "validate=empty"] ;
          uicomponent.addTextField("location", fieldLocation) ;
        %>
        </td>
      </tr>  

      <tr>                        
        <td class="FieldLabel"><label for="withMap">Google Maps ?</label></td>
        <td class="FieldComponent"> 
        <% 
          String[] fieldMaps = ["jcrPath=/node/exo:maps", "defaultValues=false"];         
          uicomponent.addCheckBoxField("withMap", fieldMaps);
        %>
        </td>
      </tr>
      
      <tr>                        
        <td class="FieldLabel"><label for="startEvent">Start Date/Time</label></td>
        <td class="FieldComponent">
          <%
            String[] fieldStartEvent = ["jcrPath=/node/exo:startEvent", "validate=datetime", "visible=true"] ; 
            uicomponent.addCalendarField("startEvent", fieldStartEvent) ;
          %>
        </td>
      </tr>
      
      <tr>                        
        <td class="FieldLabel"><label for="endEvent">End Date/Time</label></td>
        <td class="FieldComponent">
          <%
            String[] fieldEndEvent = ["jcrPath=/node/exo:endEvent", "validate=datetime", "visible=true"] ; 
            uicomponent.addCalendarField("endEvent", fieldEndEvent) ;
          %>
        </td>
      </tr>

      <tr>
        <td class="FieldLabel"><label for="url">URL</label></td>
        <td class="FieldComponent">
        <%
          String[] fieldUrl = ["jcrPath=/node/exo:url"] ;
          uicomponent.addTextField("url", fieldUrl) ;
        %>
        </td>
      </tr>  
      
      
      <tr>
        <td class="FieldLabel"><label for="summary">Summary</label></td>
        <td class="FieldComponent">
          <div class="UIFCKEditor">          
            <%
              String[] fieldSummary = ["jcrPath=/node/exo:summary", "options=toolbar:SuperBasicWCM", ""] ;
              uicomponent.addRichtextField("summary", fieldSummary) ;
            %>
          </div>
        </td>
      </tr>  
      
      <tr>
        <td class="FieldLabel"><label for="content">Content</label></td>
        <td class="FieldComponent">
          <div class="UIFCKEditor">
            <%
              String[] fieldContent = ["jcrPath=/node/exo:text", "options=toolbar:BasicWCM", ""] ;
              uicomponent.addRichtextField("content", fieldContent) ;        
            %>
          </div>
        </td>
      </tr>
    </table>
  </div>
  <% if (!uiform.isShowActionsOnTop()) {
            uiform.processRenderAction()
         }
  %>
  <%uiform.end()%>
</div>