Leszek Gawron wrote:
I have an impression that messages widget should clear for every for redisplay but:

<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition";
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1";
    xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>
    <fd:validation>
        <fd:javascript>
            widget.getChild( "messages" ).addMessage( "ERROR!" );
            return false;
        </fd:javascript>
    </fd:validation>
    <fd:widgets>
        <fd:field id="date" required="true">
            <fd:label><b>Data (rrrr.mm.dd)</b>: </fd:label>
            <fd:datatype base="date">
                <fd:convertor type="formatting">
                    <fd:patterns>
                        <fd:pattern>yyyy.MM.dd</fd:pattern>
                    </fd:patterns>
                </fd:convertor>
            </fd:datatype>
        </fd:field>
        <fd:submit id="finish">
            <fd:label>Zapisz</fd:label>
        </fd:submit>
        <fd:submit id="cancel" validate="false">
            <fd:label>Anuluj</fd:label>
        </fd:submit>
    </fd:widgets>
</fd:form>

the scenario is:

1. enter something correct in date field
2. press finish widget
3. you'll get a validation error and a message: "ERROR!"

the message never clears
4. clear date field
5. press finish widget
6. you'll have both "!" mark indicating required field was not filled and previous "ERROR!" message

is that an expected behaviour?

Nope. Are you in Ajax mode?

Sylvain

--
Sylvain Wallez                        Anyware Technologies
http://bluxte.net                     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director