You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lukas Ruetz <lu...@gmx.at> on 2005/12/08 16:39:54 UTC

contrib:MuliplePropertySelection returned selectedList is null

Hello

I'm porting my app from T3 to T4 and have a problem now with
a contrib:MuliplePropertySelection. When the form is rewinding
it sets the selectedList of my domain-object to null. While
debugging I can see that the selected values in the form are
correct handled in the MuliplePropertySelection but when it
finally sets the list on my domain-object it's null. I'm sure
I'm doing something wrong but I can't see what.

Page
 \_ MuliplePropertySelection

--- page.jwc contains
 <property name="domainObject" persist="session" />
 <component id="vpSelect" type="contrib:MultiplePropertySelection">
   <binding name="selectedList" value="ognl:domainObject.vPeriods" />
   <binding name="model" value="ognl:vPSelectionModel" />
 </component>
---

The domainObject contains
 public LinkedList<VPeriod> getVPeriod()
 public void setVPeriods( LinkedList<VPeriod> )
  ^^ this method gets called with null

The VPSelectionModel seems to work - it simply translates
between index and object. 

any ideas? thanks
luk

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


Re: contrib:MuliplePropertySelection returned selectedList is null

Posted by Lukas Ruetz <lu...@gmx.at>.
Am Samstag, 10. Dezember 2005 15:18 schrieb Kent Tong:
> Lukas Ruetz <lukas.ruetz <at> gmx.at> writes:
> >  <property name="domainObject" persist="session" />
> >  <component id="vpSelect" type="contrib:MultiplePropertySelection">
> >    <binding name="selectedList" value="ognl:domainObject.vPeriods" />
> >    <binding name="model" value="ognl:vPSelectionModel" />
> >  </component>
> >
> > The domainObject contains
> >  public LinkedList<VPeriod> getVPeriod()
> >  public void setVPeriods( LinkedList<VPeriod> )
> >   ^^ this method gets called with null
>
> It will return a java.util.List which may or may not be a
> java.util.LinkedList. Checking the code shows that it returns a
> java.util.ArrayList which is definitely not a java.util.LinkedList. So, you
> may try:
>
>   public List<VPeriod> getVPeriod();
>   public void setVPeriods(List<VPeriod> );

That works - thank you!

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


Re: contrib:MuliplePropertySelection returned selectedList is null

Posted by Kent Tong <ke...@cpttm.org.mo>.
Lukas Ruetz <lukas.ruetz <at> gmx.at> writes:

>  <property name="domainObject" persist="session" />
>  <component id="vpSelect" type="contrib:MultiplePropertySelection">
>    <binding name="selectedList" value="ognl:domainObject.vPeriods" />
>    <binding name="model" value="ognl:vPSelectionModel" />
>  </component>
> 
> The domainObject contains
>  public LinkedList<VPeriod> getVPeriod()
>  public void setVPeriods( LinkedList<VPeriod> )
>   ^^ this method gets called with null

It will return a java.util.List which may or may not be a java.util.LinkedList.
Checking the code shows that it returns a java.util.ArrayList which
is definitely not a java.util.LinkedList. So, you may try:

  public List<VPeriod> getVPeriod();
  public void setVPeriods(List<VPeriod> );

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


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