Package org.apache.tapestry.form

Examples of org.apache.tapestry.form.IPropertySelectionModel


        String[] values = cycle.getParameters(getName());

        int count = Tapestry.size(values);

        List selected = new ArrayList(count);
        IPropertySelectionModel model = getModel();

        for (int i = 0; i < count; i++)
        {
            String value = values[i];
            Object option = model.translateValue(value);

            selected.add(option);
        }

        setSelected(selected);
View Full Code Here


        PaletteColumn selectedColumn = new PaletteColumn(getName(), getClientId(), getRows());

        // Each value specified in the model will go into either the selected or available
        // lists.

        IPropertySelectionModel model = getModel();

        int count = model.getOptionCount();

        for (int i = 0; i < count; i++)
        {
            Object optionValue = model.getOption(i);

            PaletteOption o = new PaletteOption(model.getValue(i), model.getLabel(i));

            int index = selected.indexOf(optionValue);
            boolean isSelected = index >= 0;

            if (sortUser && isSelected)
View Full Code Here

            assertEquals(labels[i], model.getLabel(i));
    }

    public void testJustLabels()
    {
        IPropertySelectionModel model = newModel("Green,Red,Blue");

        assertValues(model, "Green", "Red", "Blue");
        assertLabels(model, "Green", "Red", "Blue");
    }
View Full Code Here

        assertLabels(model, "Green", "Red", "Blue");
    }

    public void testLabelsAndValues()
    {
        IPropertySelectionModel model = newModel("Red=RED,Green=GREEN,Blue=BLUE");

        assertValues(model, "RED", "GREEN", "BLUE");
        assertLabels(model, "Red", "Green", "Blue");
    }
View Full Code Here

        assertLabels(model, "Red", "Green", "Blue");
    }

    public void testBlankValue()
    {
        IPropertySelectionModel model = newModel("--Colors--=,Red=RED,Green=GREEN,Blue=BLUE");

        assertValues(model, "", "RED", "GREEN", "BLUE");
        assertLabels(model, "--Colors--", "Red", "Green", "Blue");
    }
View Full Code Here

        assertLabels(model, "--Colors--", "Red", "Green", "Blue");
    }

    public void testWhiteSpaceTrimmed()
    {
        IPropertySelectionModel model = newModel("--Colors--=\t,\n\tRed\t=\tRED\t,\n\tGreen\t=\tGREEN\t,\n\tBlue\t=\tBLUE\n");

        assertValues(model, "", "RED", "GREEN", "BLUE");
        assertLabels(model, "--Colors--", "Red", "Green", "Blue");
    }
View Full Code Here

        String[] values = cycle.getParameters(getName());

        int count = Tapestry.size(values);

        List selected = new ArrayList(count);
        IPropertySelectionModel model = getModel();

        for (int i = 0; i < count; i++)
        {
            String value = values[i];
            Object option = model.translateValue(value);

            selected.add(option);
        }

        setSelected(selected);
View Full Code Here

        PaletteColumn selectedColumn = new PaletteColumn(getName(), getClientId(), getRows());

        // Each value specified in the model will go into either the selected or available
        // lists.

        IPropertySelectionModel model = getModel();

        int count = model.getOptionCount();

        for (int i = 0; i < count; i++)
        {
            Object optionValue = model.getOption(i);

            PaletteOption o = new PaletteOption(model.getValue(i), model.getLabel(i));

            int index = selected.indexOf(optionValue);
            boolean isSelected = index >= 0;

            if (sortUser && isSelected)
View Full Code Here

     * @see org.apache.tapestry.form.AbstractFormComponent#rewindFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)
     */
    protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        String optionValue = cycle.getParameter(getName());
        IPropertySelectionModel model = getModel();
        Object value = (optionValue == null) ? null : model.translateValue(optionValue);

        updateValue(value);
    }
View Full Code Here

    public void activate(Integer fromUserId, Integer toUserId)
    {
        Person fromUser = getRemoteTemplate().getPerson(fromUserId);

        IPropertySelectionModel model = buildUserBookModel(fromUser);

        if (model.getOptionCount() == 0)
        {
            TransferBooksSelect page = getSelectPage();
            page.setError(userHasNoBooks(fromUser.getNaturalName()));
            return;
        }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.form.IPropertySelectionModel

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.