1. #1
    Ext User
    Join Date
    Oct 2008
    Location
    Warsaw(PL)/Cottbus(GER)
    Posts
    215
    Vote Rating
    0
    EagleEye666666 is on a distinguished road

      0  

    Default FormPanel validation with child Panels

    FormPanel validation with child Panels


    Iam using a Formpanel with the basic fields and to this iam adding a custom component(inherits from ContentPanel/FormPanel no difference) .

    My problem is that this fields are marked as not allowed to be blank (cuz this throw IOExcpetions on the serverside):
    Code:
    protected Widget getUploadField() {
    	final FileUploadField temp = new FileUploadField();
    	temp.setName("fileNr_"+(++fileNr));
    	temp.setAllowBlank(false);
    	return temp;
    }
    Everything works so far if the FormPanel submits it also send the added FileUploadFields... problem is here that the validation is not working. I even tried to add a listener:
    adding this panel(here i tried inherits FormPanel) to my formPanel:
    Code:
    Button btn = new Button("Upload Files");
    btn.addSelectionListener(new SelectionListener<ButtonEvent>() {
    	@Override
    	public void componentSelected(ButtonEvent ce) {
    		FormPanel upload = (FormPanel)getItemByItemId("upload");
    		if (isValid() && upload.isValid()) {
    			submit();
    		}
    		return;
    	}
    });
    
    FileUploadPanel upload = new FileUploadPanel("Files to upload");
    upload.setId("upload");
    getButtonBar().add(btn);
    add(upload);
    layout();
    all the time validation is true even the fields arent filled...

    There is missing validation check of child components if they are formfields???

    EDIT1:
    I debugged the main FormPanel do not have the FileUploadFileds as childs... so valdition is ok, cuz there are no fields. But why the heck i have on the serverside than ALL fields in the request(including the FileUploadFields)?

    EDIT2:
    I have maybe some answer, when submit a formPanel, the full DOM is added to the response right? Otherwise i can't explain why the fileuploadfields are appearing on serverside... Iam right? can somebody help me?
    Last edited by EagleEye666666; 19 Jan 2009 at 4:02 AM. Reason: further thoughts