<%@ include file="/project/include.jsp" %>

<script type="text/javascript">
function addNewAnagrafe() {
	var rec = getClientAreaRectangle().resize(600, 200, HORIZONTAL_CENTER | VERTICAL_CENTER);
	var buttons = [
			{ 'img'		: juiceGetResource('shell', 'img/misc/confirm-small.gif'),
			  'text'	: 'Crea',
			  'onclick'	: function() {addAnagrafe();}
			}
		];
		showDivModal('idAddAnagrafeEsterna', 'Configura nuovo collegamento anagrafe...', rec, true, false, buttons);		
}


function addAnagrafe() {
	var tipoAnagrafe = getComboValueById('idTipoAnagrafe');
	if (tipoAnagrafe == '') {
		alert('Specificare la tipologia.');
		return;
	}
	if (shellShowConfirmBuiBufferIsChanged()) {
		buiPrepareToCreate(cpGetMasterCurrentRow(), 'tipoAnagrafe=' + tipoAnagrafe);
	}	
}
</script>


<shell:grid description="codiceAnagrafe,20%; descrizioneAnagrafe,40%;tipoAnagrafe,20%;transcodeId,20%" />

<div id="idAddAnagrafeEsterna" class="modalElement">		
	<table width="100%" height="100%" style="padding: 20px 4px 4px 4px;">
		<tr style="vertical-align: top;">
			<td class="form-label">
				${j:bundle('LBL_configurazioneAnagrafiEsterne_tipoAnagrafe')}
			</td>
		</tr>
		<tr>
			<td class="form-values">
				<select id="idTipoAnagrafe" class="form-input">
					<option value="" selected=""></option>
					<c:forEach items="${dto_lista_tipi_anagrafe}" var="item">
						<option value="${item[0]}">${item[1]}</option>
					</c:forEach>
				</select>
			</td>
		</tr>					
	</table>								
</div>