cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject messages widget
Date Tue, 27 Dec 2005 19:22:56 GMT
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?

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message