You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Geoff Callender <ge...@gmail.com> on 2008/04/13 06:15:56 UTC

Re: [T5] [FAQ] Form and old errors/data

It's great that we have these workarounds to prevent leaving  
ValidationTrackerImpl objects littered throughout the session, but I'm  
having trouble understanding how it came to this.  After all, I can't  
think of a single case where I'd want a form's validation errors to be  
retained after the form has been displayed.  So why not make "flash"  
persistence the default for Form's ValidationTracker so we can all  
forget about it?

Geoff

On 28/02/2008, at 11:43 PM, Robert Zeigler wrote:

> You can also provide the tracker parameter to form, which looks  
> almost the same as extending form, except that you don't have to  
> extend form. :)
>
> @Component(parameters={"tracker=customTracker"})
> private Form form;
>
> @Persist("flash")
> private ValidationTracker customTracker;
>
> public ValidationTracker getCustomTracker() {
> 	if (customTracker == null) {
> 		customTracker = new ValidationTrackerImpl();
>        }
>        return customTracker;
> }
>
> Robert
>
> On Feb 28, 2008, at 2/283:39 AM , Christian Köberl wrote:
>
>>
>> Q: Why does the form show old data and old errors not the newly set  
>> object?
>> (see:
>> http://www.nabble.com/-T5--Why-is-default-ValidationTracker-in-Form-marked-Persist-not-Persist%28%22flash%22%29-td11981083.html)
>>
>> A1: Write your own form extending the tapestry default form:
>> 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;
>> 	}
>>
>> }
>>
>> A2: use @Meta("tapestry.persistence-strategy=flash") on your page  
>> to control
>> the default persistence of components below it. This will result in  
>> *all*
>> components having a default flash persistence.
>>
>> @Howard: any better idea?
>>
>> -- 
>> Chris
>> -- 
>> View this message in context: http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p15732836.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] [FAQ] Form and old errors/data

Posted by Geoff Callender <ge...@gmail.com>.
Glad to know I'm not alone.  Vote away!  https://issues.apache.org/jira/browse/TAPESTRY-2354

On 14/04/2008, at 9:25 PM, Christian Köberl wrote:

>
>
> Filip S. Adamsen-2 wrote:
>>
>> Sounds reasonable to me, is there a JIRA issue somewhere that I can  
>> vote
>> on? :D
>>
> I thought about it but I didn't as nobody seemed to have the same  
> problem
> with this behavior. I think I will do this now.
>
> -- 
> Chris
>
> -- 
> View this message in context: http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p16676273.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] [FAQ] Form and old errors/data

Posted by Christian Köberl <ch...@porsche.co.at>.

Filip S. Adamsen-2 wrote:
> 
> Sounds reasonable to me, is there a JIRA issue somewhere that I can vote 
> on? :D
> 
I thought about it but I didn't as nobody seemed to have the same problem
with this behavior. I think I will do this now.

-- 
Chris

-- 
View this message in context: http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p16676273.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] [FAQ] Form and old errors/data

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Sounds reasonable to me, is there a JIRA issue somewhere that I can vote 
on? :D

-Filip

On 2008-04-13 06:15, Geoff Callender wrote:
> It's great that we have these workarounds to prevent leaving 
> ValidationTrackerImpl objects littered throughout the session, but I'm 
> having trouble understanding how it came to this.  After all, I can't 
> think of a single case where I'd want a form's validation errors to be 
> retained after the form has been displayed.  So why not make "flash" 
> persistence the default for Form's ValidationTracker so we can all 
> forget about it?
> 
> Geoff
> 
> On 28/02/2008, at 11:43 PM, Robert Zeigler wrote:
> 
>> You can also provide the tracker parameter to form, which looks almost 
>> the same as extending form, except that you don't have to extend form. :)
>>
>> @Component(parameters={"tracker=customTracker"})
>> private Form form;
>>
>> @Persist("flash")
>> private ValidationTracker customTracker;
>>
>> public ValidationTracker getCustomTracker() {
>>     if (customTracker == null) {
>>         customTracker = new ValidationTrackerImpl();
>>        }
>>        return customTracker;
>> }
>>
>> Robert
>>
>> On Feb 28, 2008, at 2/283:39 AM , Christian Köberl wrote:
>>
>>>
>>> Q: Why does the form show old data and old errors not the newly set 
>>> object?
>>> (see:
>>> http://www.nabble.com/-T5--Why-is-default-ValidationTracker-in-Form-marked-Persist-not-Persist%28%22flash%22%29-td11981083.html) 
>>>
>>>
>>> A1: Write your own form extending the tapestry default form:
>>> 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;
>>>     }
>>>
>>> }
>>>
>>> A2: use @Meta("tapestry.persistence-strategy=flash") on your page to 
>>> control
>>> the default persistence of components below it. This will result in 
>>> *all*
>>> components having a default flash persistence.
>>>
>>> @Howard: any better idea?
>>>
>>> -- 
>>> Chris
>>> -- 
>>> View this message in context: 
>>> http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p15732836.html 
>>>
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org