Package com.ponysdk.ui.server.basic

Examples of com.ponysdk.ui.server.basic.PDateBox


        return value;
    }

    @Override
    public IsPWidget render(final FormField formField) {
        final PDateBox dateBox = new PDateBox();
        if (debugID != null) dateBox.ensureDebugId(debugID);
        final FormFieldComponent<PDateBox> dateFieldComponent = new FormFieldComponent<PDateBox>(dateBox);
        dateFieldComponent.setCaption(caption);
        dateFieldComponent.getInput().setDateFormat(dateFormat);
        dateFieldComponent.getInput().addValueChangeHandler(this);
        fields.add(dateFieldComponent);
View Full Code Here


        return calendar.getTime();
    }

    @Override
    public IsPWidget render(final FormField formField) {
        dateBox = new PDateBox();
        if (debugID != null) dateBox.ensureDebugId(debugID);
        final FormFieldComponent<PDateBox> dateFieldComponent = new FormFieldComponent<PDateBox>(dateBox);
        dateFieldComponent.setCaption(caption);
        dateFieldComponent.getInput().setDateFormat(dateFormat);
        dateFieldComponent.getInput().addValueChangeHandler(this);
View Full Code Here

                    datePicker.setTransientEnabledOnDates(false, dates("12/21/2013", "12/22/2013", "12/23/2013", "12/24/2013"));
                }
            }
        });

        dateBox = new PDateBox();
        dateBox.addValueChangeHandler(new PValueChangeHandler<Date>() {

            @Override
            public void onValueChange(final PValueChangeEvent<Date> event) {
                notifyDateChange("datebox", event.getValue());
View Full Code Here

public class DateBoxFormField extends FormField<Date> {

    private final PDateBox dateBox;

    public DateBoxFormField() {
        this(new PDateBox(), new DateConverter());
    }
View Full Code Here

    public DateBoxFormField() {
        this(new PDateBox(), new DateConverter());
    }

    public DateBoxFormField(final String dateFormat) {
        this(new PDateBox(new SimpleDateFormat(dateFormat)), new DateConverter(new SimpleDateFormat(dateFormat)));
    }
View Full Code Here

    public DateBoxFormField(final String dateFormat) {
        this(new PDateBox(new SimpleDateFormat(dateFormat)), new DateConverter(new SimpleDateFormat(dateFormat)));
    }

    public DateBoxFormField(final SimpleDateFormat dateFormat) {
        this(new PDateBox(dateFormat), new DateConverter(dateFormat));
    }
View Full Code Here

                final PLabel label1 = new PLabel("Date test");
                label1.ensureDebugId("label1");
                PRootPanel.get().add(label1);
                register(label1);

                final PDateBox dateBox1 = new PDateBox(new SimpleDateFormat(datePattern));
                dateBox1.ensureDebugId("dateBox1");
                PRootPanel.get().add(dateBox1);
                register(dateBox1);
            }
        });

        WebElement element = findElementById("dateBox1");
        final PDateBox dateBox1 = get("dateBox1");
        Assert.assertEquals(datePattern, dateBox1.getDateFormat().toPattern());

        // update date
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                final PDateBox dateBox1 = get("dateBox1");
                dateBox1.setValue(date);
            }
        });

        element = findElementById("dateBox1");
        Assert.assertEquals(dateAsString, element.getAttribute("value"));
        Assert.assertEquals(dateAsString, dateBox1.getDisplayedValue());

        // add value change handler
        updateUI(new RequestHandler() {

            @SuppressWarnings("unchecked")
            @Override
            public void onRequest() {
                final PDateBox dateBox1 = get("dateBox1");
                dateBox1.addValueChangeHandler(eventsListener);
            }
        });

        element = findElementById("dateBox1");
        element.clear();
        final PValueChangeEvent<Date> e1 = eventsListener.poll();
        Assert.assertNull(e1.getValue());

        element.click();
        element.sendKeys("");
        element.sendKeys(new String("2012-10-30"));

        element = findElementById("label1");

        final Actions actions = new Actions(webDriver);
        actions.moveToElement(element).build().perform();
        actions.click().build().perform();

        final PValueChangeEvent<Date> e2 = eventsListener.poll();
        Assert.assertEquals("2012-10-30", dateFormat.format(e2.getValue()));
        Assert.assertEquals("2012-10-30", dateBox1.getDisplayedValue());
    }
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.basic.PDateBox

Copyright © 2018 www.massapicom. 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.