public void setCheckboxSelected(boolean bSelected)
   {
      Set locales = getSelectedLocales();

      TheLocale objLocale = getCurrentLocale();
       if (bSelected)
           locales.add(objLocale);
       else locales.remove(objLocale);

       setSelectedLocales(locales);  <-------------------------------
   }

Tapestry and the session manager won't recognize that you've made
changes to your locales Set unless you explicitly call
setSelectedLocales again.

I tried once to add a proxy mechanism to common classes like
collections and such so that Tapestry could automatically detect these
changes as well but it proved to be too error prone and cause problems
with hibernate / other persistence libraries.

On Nov 7, 2007 11:07 AM, cometta <[EMAIL PROTECTED]> wrote:
> is this the correct way to persists session?
>
> .page
>
> <property name="selectedLocales" persist="session" initial-value="new
> java.util.HashSet()"/>
>
>
> .java
>
> public abstract Set getSelectedLocales();
> public abstract void setSelectedLocales(Set set);
>
> public void setCheckboxSelected(boolean bSelected)
>     {
>        TheLocale objLocale = getCurrentLocale();
>         if (bSelected)
>             getSelectedLocales().add(objLocale);
>         else getSelectedLocales().remove(objLocale);
>
>
>
>     }
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to