/**
 * @author schiesser
 */
Ext.ns('efiport.login.view');

efiport.login.view.firstNameBirthDate = function(widget){
    var that = {};
	
	var firstNameField = Ext.ComponentMgr.create({
            xtype: 'textfield',
            emptyText: 'Ihr Vorname',
            name: 'firstName',
            allowBlank: false,
            blankText: 'Bitte geben Sie Ihren Vornamen an',
			anchor: '50%'
        });
		
    var birthDateField = new Ext.form.DateField({
            emptyText: 'Ihr Geburtsdatum',
            blankText: 'Bitte geben Sie Ihr Geburtsdatum an',
            name: 'birthDate',
			format: 'd.m.Y',
            allowBlank: false,
			anchor: '50%'
        });
		
	var commit = function() {
		if (that.panel.getForm().isValid()) {
			widget.clogin.loginUnique(firstNameField.getValue(),
			birthDateField.getValue());
		}
	};
	
    that.panel = new Ext.form.FormPanel({
		hideLabels: true,
		header: false,
		border: false,
        width: 500,
        keys: {
            key: Ext.EventObject.ENTER,
            fn: commit
        },
		
        items: [{
			border: false,
			html: widget.firstNameText
		}, firstNameField, birthDateField]
        
    });
	
	that.panel.addButton('Weiter', commit);
	
	return that;
};


