Antwort: Re: [T5] Why is default ValidationTracker in Form marked Persist not Persist(flash)

2007-08-04 Thread Christian Koeberl
 By making it @Persist (i.e. with default), then the container (i.e., your page) can set a @Meta to control the default persistence of componentsbelow it. Thus, if you want the default to be "flash", you're in luck.So, you think every page in every T5 app in the world should override the default persistence to "flash"? I don't think that's good - Tapestry should have reasonable defaults. Most of the newbies will have big problems with the defaultTracker to be in the session - most will think T5 has a bug because it does not clear form errors on leaving the page.If somebody wants some other behaviour, he/she could still set another tracker parameter to the form. Or,you caninjecttheFormcomponent,ithasmethodsthatoverlapValidationDelegate for clearing errors  etc. (it just delegates toits ValidationDelegate).I don't think dealing with clearing errors manually on page-leave should be the concern of the "normal" programmer - the framework should do this at reasonable points (with the option to clear them manually).-- Chris
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Antwort: Re: [T5] Why is default ValidationTracker in Form marked Persist not Persist(flash)

2007-08-04 Thread Christian Koeberl
 Couldyougiveusanexampleofhowtoaccomplishthis?What we did is to extend the Form component with a flash-persist defaultTracker. We're using our Form component everywhere:public class Form extends org.apache.tapestry.corelib.components.Form{ @Persist("flash") private ValidationTracker defaultTracker; @Override public ValidationTracker getDefaultTracker() {  if (defaultTracker == null)   defaultTracker = new ValidationTrackerImpl(); return defaultTracker; } @Override public void setDefaultTracker(ValidationTracker defaultTracker) {  this.defaultTracker = defaultTracker; }}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]