Package org.apache.click.control

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


       
        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());
    }

    /**
     * Sanity checks for ClickUtils.copyObjectToForm.
View Full Code Here


        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

        // Process form to bind request parameter to field
        form.onProcess();

        Car car = new Car();
        form.copyTo(car);

        assertEquals(price, priceField.getValue());
    }

    /**
 
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

        // Assert that the bound priceField value is equal to price
        assertEquals(price, priceField.getValue());

        Car car = new Car();
        form.copyTo(car);

        // Assert that the copied part price value is equal to the price
        assertEquals(price, Double.toString(car.getPart().getPrice()));
    }
View Full Code Here

        // Assert that the bound priceField value is equal to price
        assertEquals(price, priceField.getValue());

        Car car = new Car();
        form.copyTo(car);

        // Assert that the copied part price value is equal to the price
        assertEquals(price, Double.toString(car.getPart().getPrice()));
    }
View Full Code Here

        // Assert that the bound priceField value is equal to price
        assertEquals(price, priceField.getValue());

        Car car = new Car();
        form.copyTo(car);

        // Assert that the copied part price value is equal to the price
        assertEquals(price, Double.toString(car.getPart().getPrice()));
    }
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());
    }

    /**
     * Sanity checks for ClickUtils.copyObjectToForm.
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.