propertiesEditor

Description: A property editor that supports multiple property nodes in a side tree element.
Properties will be rendered each in it's own row of the editing grid and can have different types and option lists.
The side tree is optional and can be used to select multiple set's of properties to edit.

JavaDoc: Click here

Remarks: Tree is optional. Single set of properties will be rendered in unavailable. This component acts as a footnote container.

Body content: JSP context.

Attributes:

Name Description Data type Required Default value
id The name (identifier) of the property editor. String Yes -
height Property editor height (with scroll if larger). Integer No auto
items The item list ListTreeItemDefinition No Inner TreeItem components
ajaxEvent An AJAX event to load the data for the grid. In the form "eventID" or "stageID:eventID". String Yes -
title The title for the editor. String No -

Examples:

View - JSP file

<dif:propertiesEditor id="props" items="${stage.configItems}" props="${stage.props}" />

Stage - Class file

    @Parameter
    String selectedItem;

    public List<TreeItemDefinition> getConfigItems()
    {
        List<TreeItemDefinition> items = new ArrayList<TreeItemDefinition>();
        (...)
        return items;
    }

    /**
     * @return the list of configurations for the selected configuration point
     */
    /**
     * @param context
     * @return list of properties
     */
    @OnAJAX("props")
    public IJSONResponse manageProperties(IDIFContext context)
    {
        JSONResponsePropertyEditor response = new JSONResponsePropertyEditor(context);

        if (response.isUpdate())
        {
            Map<String, String> propsMap = response.getChangedPropertiesMap();
            (...) // Process the changed property list received
        }
        else
        {
            // If the request for the list of properties
            List<PropertiesEditorItem> props = new ArrayList<PropertiesEditorItem>();

            if (selectedItem != null)
            {
                for (SomeBean bean: getListOfBeans())
                {
                    PropertiesEditorItem item = new PropertiesEditorItem();
                    item.setName(bean.getName());
                    item.setItemType(bean.getItemClass());
                    item.setCustomValue(bean.isCustomized());
                    item.setLabel(bean.getLabel());
                    item.setValue(bean.getValue());

                    props.add(item);
                }
            }

            response.setProperties(props);
        }

        return response;
    }

Screenshots:

Properties Editor component sample

See also:

Back to tag reference