On Thursday 25 April 2002 06:01 pm, you wrote:
> I'm afraid that parameters don't work quite the way you
> expect.
>
> Defining a parameter for a component means that Tapestry
> will attempt to set a property named xyzBinding (for
> parameter 'xyz') and the value is an instance of
> IBinding.
>
> You can dereference your List by invoking
> binding.getValue().
>
> The place to do this is in your render method:
>
> public void render(....)
> {
>   IBinding moviesBinding = getBinding("movies");
>
>   _movies = (List)moviesBinding.getValue("movies",
> List.class);
>
>   super.render(...);
>
>   _movies = null;
> }
>
Thanks for the responses Howard and Richard. I tried both and they both 
worked like champs :)  I went with Richard's solution after slight 
modification since it isolates the bound property specific code in the get() 
method for that property:

---MovieList.java---
...
    public List getMovies()
    {
        IBinding moviesBinding = getBinding( "movies" ) ;
        return ( List ) moviesBinding.getObject("movies", List.class ) ;
    }

> I've recently updated the developer guide FAQ with a
> discussion about this, but in summary:
> - Is this too complicated? Yes.
> - Why? To support the (rare) component that needs to
> update through its bindings.  I let the exceptional case
> make the common case very unpleasant!
> - What can be done?  A bit of surgery!

Being a newbie, I was expecting the binding to happen 'auto-magically' ;).  
It would be cool if it was auto-magic - I'm not familiar enough with Tapestry 
to be aware of the implications.

> I'll be opening this up for discussion, for inclusion
> in 2.0.2 or 2.0.3 perhaps.  The problem is that any fix
> will break a lot of existing components.
>
> See:
> http://tapestry.javanuke.org/doc/DevelopersGuide/componen
> ts.html#components.params

_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to