You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by D&J Gredler <dj...@gmail.com> on 2006/05/18 23:17:55 UTC

Rewind Question

I'm having some rewind trouble...

I have a custom component (call it a "Foo") which contains a Form. This
"Foo" component has a required parameter (call it "baz"). Furthermore, this
"Foo" component contains a For component (inside the Form) whose "source"
parameter is a method call whose return value depends on "Foo.baz". The page
that contains the Foo component renders fine. However, during the rewind
phase, Tapestry tries to loop through this For component, thus calling the
method bound to its "source" parameter. That's fine, but said method depends
on the "Foo.baz" required parameter, which at this point is null for some
reason.

Does anyone have any advice??

Daniel


-------------------
Some code:
-------------------

<component-specification class="Foo">
    <parameter name="baz" required="true"/>
    ...
    <component id="for" type="For">
        <binding name="source" value="getProperties( )"/>
        ...
    </component>
    ...
</component-specification>


public abstract class Foo {
    ...
    public abstract Object getBaz( );
    public abstract void setBaz( Object baz );
    ...
    public List getProperties( ) {
        Defense.notNull( getBaz( ), "baz" );
        ...
    }
    ...
}

Re: Rewind Question

Posted by D&J Gredler <dj...@gmail.com>.
Marking as persistent the page property which is passed to Foo's required
parameter "baz" seems to fix the problem... is there a way of making a
component parameter persistent without forcing the containing page to do it?

On 5/18/06, D&J Gredler <dj...@gmail.com> wrote:
>
> I'm having some rewind trouble...
>
> I have a custom component (call it a "Foo") which contains a Form. This
> "Foo" component has a required parameter (call it "baz"). Furthermore, this
> "Foo" component contains a For component (inside the Form) whose "source"
> parameter is a method call whose return value depends on " Foo.baz". The
> page that contains the Foo component renders fine. However, during the
> rewind phase, Tapestry tries to loop through this For component, thus
> calling the method bound to its "source" parameter. That's fine, but said
> method depends on the " Foo.baz" required parameter, which at this point
> is null for some reason.
>
> Does anyone have any advice??
>
> Daniel
>
>
> -------------------
> Some code:
> -------------------
>
> <component-specification class="Foo">
>     <parameter name="baz" required="true"/>
>     ...
>     <component id="for" type="For">
>         <binding name="source" value="getProperties( )"/>
>         ...
>     </component>
>     ...
> </component-specification>
>
>
> public abstract class Foo {
>     ...
>     public abstract Object getBaz( );
>     public abstract void setBaz( Object baz );
>     ...
>     public List getProperties( ) {
>         Defense.notNull( getBaz( ), "baz" );
>         ...
>     }
>     ...
> }
>
>