Package org.apache.click.control

Examples of org.apache.click.control.Form.copyTo()


        TextField stateCodeField = new TextField("address.state.code");
        stateCodeField.setValue(stateCode);
        form.add(stateCodeField);

        // Copy the fields values back into the map
        form.copyTo(map, true);

        // Test that values were copied
        String copiedId = map.get("id").toString();
        assertEquals(id, new Integer(copiedId));
        assertEquals(name, map.get("name"));
View Full Code Here


        TextField codeField = new TextField("address.state.code");
        codeField.setValue(code);
        form.add(codeField);
       
        User user = new User();       
        form.copyTo(user, true);
       
        assertNull(user.getAddress().getId());
        assertEquals(lineOne, user.getAddress().getLineOne());       
        assertEquals(active, user.getAddress().isActive());
        assertEquals(registered, user.getAddress().isRegistered());
View Full Code Here

       
        form = new Form();
        TextField codeField = new TextField("address.state.code");
        codeField.setValue("NSW");
        form.add(codeField);
        form.copyTo(user, true);
        assertEquals("NSW", user.getAddress().getState().getCode());
    }

    public void testCopyObjectToForm() {
        // set up the form
View Full Code Here

        TextField codeField = new TextField("address.state.code");
        codeField.setValue(code);
        form.add(codeField);
       
        User user = new User();       
        form.copyTo(user, true);
       
        assertNull(user.getAddress().getId());
        assertEquals(lineOne, user.getAddress().getLineOne());       
        assertEquals(active, user.getAddress().isActive());
        assertEquals(registered, user.getAddress().isRegistered());
View Full Code Here

        String decimalValue = "0.1";
        decimalField.setValue(decimalValue);
        form.add(decimalField);

        MyObj obj = new MyObj();
        form.copyTo(obj);

        assertEquals(decimalValue, obj.decimalField.toString());
    }
   
    public static class MyObj {
View Full Code Here

        form.add(bigDecimalField);
        bigIntegerField.setValue(bigValue);
        form.add(bigIntegerField);

        MyObj obj = new MyObj();
        form.copyTo(obj);

        assertEquals(bigValue, obj.bigDecimalField.toString());
        assertEquals(bigValue, obj.bigIntegerField.toString());
    }
View Full Code Here

        form.add(bigDecimalField);
        bigIntegerField.setValue(bigValue);
        form.add(bigIntegerField);

        MyObj obj = new MyObj();
        form.copyTo(obj);

        assertEquals(bigValue, obj.bigDecimalField.toString());
        assertEquals(bigValue, obj.bigIntegerField.toString());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.