You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Engelhart <me...@mac.com> on 2004/12/01 13:41:59 UTC

Dynamic PropertySelection requires persistence?

Hi -

I have a subclass of PropertySelection that I back with a database 
supplied java.util.List of items depending on what the user enters into 
a search form.   I'm getting a NullPointerException when I select an 
item from the PropertySelection and click submit.   I put some 
debugging code in and it seems the List that my model is backed by is 
set to null somewhere in the prøcess.    Do I have to make the model a 
persistent page property for this to work?  In other words does 
Tapestry discard my Model as soon as the page is rendered?

Thanks for any help.
Michael

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


Re: Dynamic PropertySelection requires persistence?

Posted by Michael Engelhart <me...@mac.com>.
Thanks Erik -

In my model I have a setPropertyList() method for the model's List 
which I've been updating during the validation section of my Page code. 
  Being new to the concept of rewinding/rendering, what sections of my  
code do I look at to make sure that it's being created/updated for 
rewind/render?   I do the validation inside my page's listener.submit 
method so I thought that modifying the backing list by calling 
MyPropertySelection.setPropertyList(List) would update during the 
render.   I also have tried creating a new PropertySelection object by 
passing in the List to the constructor but that also failed with a 
NullPointerException being that the List was still null.   Do I need to 
use a Tapestry.fireChangedObserver() call to update something?

Thanks again for your help.
Mike

On Dec 1, 2004, at 8:18 AM, Erik Hatcher wrote:

> The model doesn't have to be persistent, but the same model needs to 
> be created both during render and rewind.  Since you're backing it 
> with a database,  you may want to have some caching going on 
> (depending on how frequently the data changes).
>
> 	Erik
>
> On Dec 1, 2004, at 7:41 AM, Michael Engelhart wrote:
>
>> Hi -
>>
>> I have a subclass of PropertySelection that I back with a database 
>> supplied java.util.List of items depending on what the user enters 
>> into a search form.   I'm getting a NullPointerException when I 
>> select an item from the PropertySelection and click submit.   I put 
>> some debugging code in and it seems the List that my model is backed 
>> by is set to null somewhere in the prøcess.    Do I have to make the 
>> model a persistent page property for this to work?  In other words 
>> does Tapestry discard my Model as soon as the page is rendered?
>>
>> Thanks for any help.
>> Michael
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


Re: Dynamic PropertySelection requires persistence?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
The model doesn't have to be persistent, but the same model needs to be 
created both during render and rewind.  Since you're backing it with a 
database,  you may want to have some caching going on (depending on how 
frequently the data changes).

	Erik

On Dec 1, 2004, at 7:41 AM, Michael Engelhart wrote:

> Hi -
>
> I have a subclass of PropertySelection that I back with a database 
> supplied java.util.List of items depending on what the user enters 
> into a search form.   I'm getting a NullPointerException when I select 
> an item from the PropertySelection and click submit.   I put some 
> debugging code in and it seems the List that my model is backed by is 
> set to null somewhere in the prøcess.    Do I have to make the model a 
> persistent page property for this to work?  In other words does 
> Tapestry discard my Model as soon as the page is rendered?
>
> Thanks for any help.
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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