<table class="FormFieldTable">
	<tr>
        <th></th>
        <th></th>
		<th align="center" ng-repeat="header in attributes"  >
		&nbsp;&nbsp;{{header.alias}}
		</th>
	</tr>

	<tr ng-repeat="obj in objects" >
	    <td ng-if="obj.group===true">
	        <img ng-show="!obj.visible" ng-click="showGroup(obj,true)" src="img\biz\yamoussoukro\21_px_unfold.png"/> 
	        <img ng-show="obj.visible" ng-click="showGroup(obj,false)" src="img\biz\yamoussoukro\21_px_fold.png"/>
	    </td>
        <td ng-if="obj.group===true" colspan="{{obj.colcount}}">
            <label ng-if="obj.val!='__xx__'">{{obj.val}}</label>            
        </td>
        <td ng-if="obj.group!==true" ng-show="isMyGroupVisible(obj)">
        </td>
        <td ng-if="obj.group!==true" ng-show="isMyGroupVisible(obj)" style="text-align: center">
                <i class="fa fa-arrow-up"  ng-if="manageOrder" 
                   ng-show="$index!=1" ng-click="up(obj)" ></i>
                <BR ng-if="manageOrder">
                 <button ng-click="delRecord(obj);" ng-disabled="!enabled || obj.readonly=='true'"
                                style="padding-left: 3px; padding-right: 3px;">
                            <img src="img/common/16px-List-remove.png">
                        </button>
                <BR ng-if="manageOrder">
                <i class="fa fa-arrow-down"   ng-if="manageOrder"
                   ng-show="$index!=objects.length-1" ng-click="down(obj)" ></i>
	    </td>
		<td ng-repeat="att in attributes" ng-if="obj.group!==true"  ng-show="isMyGroupVisible(obj)">
			<input class="form-group" type="text" 
			       ng-if="att.type=='java.lang.String' && !att.fieldTypeIsDomain && att.size<=255" 
				   ng-model="obj.properties[att.name]"
				   ng-model-options="{ debounce: 500 }"
				   ng-disabled="!enabled || obj.readonly=='true'"
				   ng-change="valueChanged({{obj}})"
				   ng-readonly="att.readonly"
				   style="color:#000000;" />

                  <!-- Big text field : comments -->
                  <table ng-if="att.type=='java.lang.String' && !att.fieldTypeIsDomain && att.size>255">
                      <tr>
                          <td>
                              <textarea type="text" class="form-control" ng-change="valueChanged({{obj}})"
                                     rows="2"
                                     ng-disabled="!enabled || obj.readonly=='true'"
                                     ng-model-options="{ debounce: 500 }"
                                     ng-model="obj.properties[att.name]" >
                              </textarea>
                          </td>
                          <td>
                              <img src="img/common/8px-View-fullscreen.png" title='Grande zone de saisie'
                                   ng-show="!hideSmallViewComment" ng-init="hideSmallViewComment=false"
                                   ng-click="openCommentInput(obj,att.name)" ng-mouseover="hideSmallViewComment=true" /> 
                              <img src="img/common/16px-View-fullscreen.png" title='Grande zone de saisie' 
                                   ng-show="hideSmallViewComment" 
                                   ng-click="openCommentInput(obj,att.name)" ng-mouseleave="hideSmallViewComment=false" /> 
                          </td>
                      </tr>
                  </table>
  
				   
			<input class="form-group" type="number"
			       ng-if="!att.fieldHasUnit && (att.type=='java.lang.Integer' || att.type=='java.lang.Double' || att.type=='java.lang.Float') && !att.fieldTypeIsDomain && !att.fieldTypeIsInterval" 
				   ng-model="obj.properties[att.name]"
				   ng-disabled="!enabled || obj.readonly=='true'"
                   ng-readonly="att.readonly || obj.readonly=='true'"
				   ng-change="valueChanged({{obj}})" 
				   style="color:#000000;margin-bottom:0px;" />
                      <table ng-show="att.fieldHasUnit">
                        <tr>
                            <td>
                              <input type="text" numbers-only class="form-control" 
                                 ng-class="{ 'form-control': !requiredValueIsNull , 'form-control mandatoryField': requiredValueIsNull  }"
                                 ng-if="(att.type=='java.lang.Integer' || att.type=='java.lang.Double' || att.type=='java.lang.Float') && !att.fieldTypeIsDomain"
                                 ng-attr-title="{{theField01.objectField.value+' '+dbUnit}}"
                                 ng-disabled="!enabled || obj.readonly=='true'"
                                 ng-readonly="att.readonly || obj.readonly=='true'"
                                 ng-model="obj.displayProperties[att.name]"
                                 ng-change="unitChanged({{obj}},{{att}})" 
                                 style="color:#000000;font-size:12px;" >
                              </input>
                            </td>
                            <td>
                              <select ng-if="att.fieldHasUnit"
                                      ng-options="unit.factor as unit.symbol for unit in att.unitDesc.multiple"
                                      ng-attr-title="{{att.currentUnitFactor.value.tooltip}}"
                                      ng-model="obj.objAttCfg[att.name].currentUnitFactor.value"
                                      ng-disabled="!enabled || obj.readonly=='true'"
                                      style="color:#000000;font-size:12px;"
                                      ng-change="unitChanged({{obj}},{{att}})"
                                    >
                              </select>
                            </td>
                        </tr>      
                      </table>
  
		    <div class="form-group" ng-if="att.fieldTypeIsDate" 
			  						  ng-class="{'has-error': datepickerForm.date.$invalid}">
			      <input type="text" class="form-control" style="min-width:100px;" 
			      		 data-date-format="dd/MM/yyyy"
			      		 data_autoclose="true"  
			      		 ng-model="obj.properties[att.name]"
			      		 ng-disabled="!enabled || att.readonly || obj.readonly=='true'"
					     ng-change="valueChanged({{obj}})"
			      		 name="date" bs-datepicker />
			</div>
			
			<!-- Dropdown value list for domains -->
					<!-- 
					ng-change="valueChanged()"
					 -->
			<select class="select01" 
			        ng-if="att.fieldTypeIsDomain"
			        ng-disabled="!enabled || obj.readonly=='true'"
                    ng-model="obj.properties[att.name]"
                    ng-init="obj.properties[att.name]"
				    ng-change="valueChanged({{obj}})"
			        ng-attr-title="{{getValueFor(obj,att)}}" 
			        style="max-width:200px;"
			        ng-options="desc.code as desc.value for desc in att.listOfValues">
			</select>

              <!-- Dropdown value list from table -->
              <table ng-if="att.type=='relationListOfValue'">
                  <tr>
                      <td>
                          <select name="fft4u2_select" id="select_{{$id}}"
                                  ng-class="{ 'form-control': !requiredValueIsNull , 'form-control mandatoryField': requiredValueIsNull  }"
                                  ng-model="obj.properties[att.name]"
                                  ng-change="valueChanged({{obj}})" 
                                  style="max-width: 300px;min-width:150px;"
                                  ng-disabled="!enabled || obj.readonly=='true'"
                                  ng-options="val.code as val.value for val in att.listOfValues | orderBy:'value'"
                                  >
                          </select>
                      </td>
                  </tr>      
              </table>
  
		    <ffl2AttachmentDirective ng-if="att.fieldTypeIsSingleAttachment" 
		  				my-cardinality="1" the-feature="{{obj}}" readonly-when-set="{{att.readonlyWhenSet}}" >
		    </ffl2AttachmentDirective>
  
   		    <ffl2AttachmentDirective ng-if="att.fieldTypeIsMultipleAttachments" 
  				my-cardinality="n" the-feature="{{obj}}" readonly-when-set="att.readonlyWhenSet" >
            </ffl2AttachmentDirective>

            <intervalFieldDirective ng-if="att.fieldTypeIsInterval" 
                the-field="att" readonly-when-set="att.readonlyWhenSet" >
            </intervalFieldDirective>
		</td>
	</tr>
</table>
<button ng-click="addNewRecord();" ng-disabled="!enabled">
    <img src="img/common/16px-List-add.png">
</button>
<div style="height:5px;"></div>

<!-- 
<div FormFieldGroupDirective ng-repeat="theField in fieldGroups">
</div>
 -->

