package it.infracom.wintar.webUI.client.plugins;

import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;

import it.infracom.jequisetum.GWT.baseClasses.BasePlugin;
import it.infracom.jequisetum.GWT.baseControls.WDataSource;
import it.infracom.wintar.commonDefinitionSrvUI.constants.CommonSrvUIConstants;

public class MobileSelectListSample extends BasePlugin {  
  
    public  MobileSelectListSample() {  
        DynamicForm form = new DynamicForm();  
        form.setWidth(500);  
  
      SelectItem filteredSelect = new SelectItem();  
        filteredSelect.setName("tipoLegame");  
        filteredSelect.setTitle("tipoLegame");  
        filteredSelect.setOptionDataSource(WDataSource.getInstance( CommonSrvUIConstants.DMN_TIPO_LEGAME, null, CommonSrvUIConstants.DOMAIN_ID_FIELD ) );  
        filteredSelect.setDisplayField("id");  
        filteredSelect.setValueField("descrizione");  
        filteredSelect.setPickListPlacement("fillScreen");  
        filteredSelect.setPickListWidth(300);  
        ListGrid pickListGridProperties = new ListGrid();  
        pickListGridProperties.setShowFilterEditor(true);  
        filteredSelect.setPickListProperties(pickListGridProperties);  
        ListGridField skuField = new ListGridField("id", "id");  
        ListGridField itemNameField = new ListGridField("descrizione", "descrizione");  
        filteredSelect.setPickListFields(skuField, itemNameField);
       
   SelectItem filteredSelect2 = new SelectItem();  
        filteredSelect2.setName("tipoRapporto");  
        filteredSelect2.setTitle("tipo Rapporto");  
        filteredSelect2.setOptionDataSource(WDataSource.getInstance( CommonSrvUIConstants.DMN_TIPO_RAPPORTO, null, CommonSrvUIConstants.DOMAIN_ID_FIELD ) );  
        filteredSelect2.setDisplayField("id");  
        filteredSelect2.setValueField("descrizione");  
        filteredSelect2.setPickListPlacement("fillScreen");  
        filteredSelect2.setPickListWidth(300);  
        ListGrid pickListGridProperties2 = new ListGrid();  
        pickListGridProperties2.setShowFilterEditor(true);  
        filteredSelect2.setPickListProperties(pickListGridProperties2);  
        ListGridField skuField2 = new ListGridField("id", "id");  
        ListGridField itemNameField2 = new ListGridField("descrizione", "descrizione");  
        filteredSelect2.setPickListFields(skuField2, itemNameField2);
       
      /*  
        SelectItem filteredSelect3 = new SelectItem();  
        filteredSelect3.setName("TipoRegistrazione");  
        filteredSelect3.setTitle("Tipo Registrazione");  
        filteredSelect3.setOptionDataSource(WDataSource.getInstance( CommonSrvUIConstants.DMN_TIPO_REGISTRAZIONE, null, CommonSrvUIConstants.DOMAIN_ID_FIELD ) );  
        filteredSelect3.setDisplayField("id");  
        filteredSelect3.setValueField("descrizione");  
        filteredSelect3.setPickListPlacement("fillScreen");  
        filteredSelect3.setPickListWidth(300);  
        ListGrid pickListGridProperties3 = new ListGrid();  
        pickListGridProperties3.setShowFilterEditor(true);  
        filteredSelect3.setPickListProperties(pickListGridProperties3);  
        ListGridField skuField3 = new ListGridField("id", "id");  
        ListGridField itemNameField3 = new ListGridField("descrizione", "descrizione");  
        filteredSelect3.setPickListFields(skuField3, itemNameField3);
       
        
    */    
       /* SelectItem filteredSelect4 = new SelectItem();  
        filteredSelect4.setName("Valuta");  
        filteredSelect4.setTitle("Select Item");  
        filteredSelect4.setOptionDataSource(WDataSource.getInstance( CommonSrvUIConstants.DMN_VALUTA, null, CommonSrvUIConstants.DOMAIN_ID_FIELD ) );  
        filteredSelect4.setDisplayField("id");  
        filteredSelect4.setValueField("descrizione");  
        filteredSelect4.setPickListPlacement("fillScreen");  
        filteredSelect4.setPickListWidth(300);  
        ListGrid pickListGridProperties4 = new ListGrid();  
        pickListGridProperties4.setShowFilterEditor(true);  
        filteredSelect4.setPickListProperties(pickListGridProperties4);  
        ListGridField skuField4 = new ListGridField("id", "id");  
        ListGridField itemNameField4 = new ListGridField("descrizione", "descrizione");  
        filteredSelect4.setPickListFields(skuField4, itemNameField4);
        
        */
        form.setFields(filteredSelect, filteredSelect2);  
      
        addMember(form);
        
        form.draw();  
    }

	@Override
	protected void onFillData(Object data) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void onSetData(Object data) {
		// TODO Auto-generated method stub
		
	}  
  
}  