[opencms-dev] set widget parameter of self-made widget, reading property of resource

peter felkel peter_hamburg at fastmail.fm
Mon Oct 2 13:14:53 CEST 2006


Hello *,

i´m experiencing the following problem:

I have created my own widget containing some checkboxes.
after editing a resource containing this widget the checkbox values are
set via
I_CmsWidgetParameter.setStringValue. (merged String of all active
checkboxes)


Here is the setEditorValue method of my Widget:

    public void setEditorValue(CmsObject cms, Map formParameters,
    I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) {
        LOG.error("executed: setEditorValue");
        String[] values = (String[]) formParameters.get(param.getId());
        if (values != null) {
            param.setStringValue(cms, createParamValue(values));
        }
        else {
            param.setStringValue(cms, null);
        }
    }

In addition i have implemented the Cms Event Listener, which reads the
property of an edited Resource.


Everything works fine. Selected checkboxes are set after editing a
resource, and the property, read at the eventlistener contains the right
value. 
But if i uncheck all checkboxes (expecting to get a nullproperty at the
listener), i get the "old" propertyvalue containing the string of the
pre-edit status.


Is there any known bug ?
I´m looking at my sourcecode now for a while but can´t find any semantic
errors.


Any hint/help appreciated

regards Peter F.



-- 
  peter felkel
  peter_hamburg at fastmail.fm

-- 
http://www.fastmail.fm - The way an email service should be




More information about the opencms-dev mailing list