Wouter, I'm comparing dates... It isn't possible to use the String instance because the comparison doen't work the correct way (I'm using 'dd/MM/yyyy' instead of 'yyyy/MM/dd' which could work).
Actually I just realize the Date instance will not work too, because the validwhen uses the toString() method, and the Date.toString() returns a string not suitable to comparison too. I don't know what to do. Maybe extending the java.util.Date data type in a way to be used directly by Struts. I can try that, if you think it's a good idea. Please let me know. One question: is it dificult implement the action/parameter validation using OCL instead of the validwhen ? Just an idea... regards, Wallter <[EMAIL PROTECTED]> writes: >Walter, > >That was the initial implementation, getField was returning a Date and >getFieldAsString was returning the String. In the JSP you would call the >form field 'fieldAsString'. > >I don't remember exactly why, but I really had to change it because of >some >side-effects too. I always disliked the fact that the field with the >actual >name modeled had a different type in the generated code. > >I'm sure it had something to do with the Struts validation framework not >accepting it if it wasn't a String, and because the generated validation >routines can't easily be modified I chose to do it this way > >But again, I do agree with you. > >Why would you need the date instance in valid when ? Are you comparing >dates >or something ? Is that even possible using the '<' and '>' operators ? I >think it's better to work with the String version anyway, can you let me >know why you really want a Date ? I'm trying to understand. > >-- Wouter > > >> -----Original Message----- >> From: Walter Mourão [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, March 22, 2005 7:17 PM >> To: Wouter Zoons >> Cc: andromda-user@lists.sourceforge.net >> Subject: validwhen & AsDate suffix >> >> Hi Wouter, >> >> I saw a bad side effect of using the "AsDate" suffix in form's date type >> fields, the modeler must use "fieldAsDate" instead of "field" when using >> the validwhen validator, to get the desired validation. >> >> I'm thinking about using the "AsString" suffix in the String version of >> the getters and setters, keeping the Date field with its original name. >> >> What do you think ? >> >> >-------------------------------------------------------------------------- >> - >> Walter Itamar Mourão - Diretor de Tecnologia e Projetos - Arcadian S/A >> www.arcadian.com.br > > > >------------------------------------------------------- >This SF.net email is sponsored by: 2005 Windows Mobile Application Contest >Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones >for the chance to win $25,000 and application distribution. Enter today at >http://ads.osdn.com/?ad_idh82&alloc_id148&op=Click >_______________________________________________ >Andromda-user mailing list >Andromda-user@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/andromda-user > --------------------------------------------------------------------------- Walter Itamar Mourão - Diretor de Tecnologia e Projetos - Arcadian S/A www.arcadian.com.br ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click _______________________________________________ Andromda-user mailing list Andromda-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/andromda-user