You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kai Michael Bodach <ka...@condat.de> on 2004/04/23 16:16:04 UTC

Block & Inserter Problem

Hi all,

i have a little problem with the component Block and RenderBlock. In my
situation I have a page, which a RenderBlock component, which renders Blocks
from foreign pages. The target Block is dependent of the type of a selected
object (The name of the page and the block, which will be rendered is
accesible throw a polymorph method of the abstract type). This Blocks are
filled with different components, but all have a Form inside. The
RenderBlock has a informal parameter which holds the selected object. With
the Block inserter property the components, which are in the Block have
access to this object. This works all fine. But if I submit the Form, which
is in this Block, the inserter is null and I have no access to the object. I
tryed to make the given object persistent in that Block component, but then
I fall into a ApplicationRuntimeException (Page recorder for page ??? is
locked after commit(), but received a change to property ... ). I think that
is because I use the prepareForRender(...) method to set the property ...
but I can't use the pageBeginRender(...) because the Block are in a foreign
page. The only way it works now is to use the visit object, but that makes a
relationship between the Blocks and the Visit and I want to avoid that. Has
anybody a idea or a hint, or a solution from a similar situation ??? 

Thanks for help me out ...

-kai

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


Re: Block & Inserter Problem

Posted by Norbert Sándor <pr...@hotmail.com>.
You should force the Form to use the action service instead of direct (which
is the default). See the "direct" parameter of Form.
Of course your forms will have all drawbacks of the action service...

(Where I prefer direct service, I use some dirty tricks :] I embed Block
into components which have "auto" parameters, accessible at submit time,
too. I access these parameters using getContainer().getBlaBla() from the
Block... It's an ugly hack.)

Hopefully the parameter enhancements in 3.1 would solve this in/auto
parameter problem.

Norbi

----- Original Message ----- 
From: "Kai Michael Bodach" <ka...@condat.de>
To: <ta...@jakarta.apache.org>
Sent: Friday, April 23, 2004 4:16 PM
Subject: Block & Inserter Problem


> Hi all,
>
> i have a little problem with the component Block and RenderBlock. In my
> situation I have a page, which a RenderBlock component, which renders
Blocks
> from foreign pages. The target Block is dependent of the type of a
selected
> object (The name of the page and the block, which will be rendered is
> accesible throw a polymorph method of the abstract type). This Blocks are
> filled with different components, but all have a Form inside. The
> RenderBlock has a informal parameter which holds the selected object. With
> the Block inserter property the components, which are in the Block have
> access to this object. This works all fine. But if I submit the Form,
which
> is in this Block, the inserter is null and I have no access to the object.
I
> tryed to make the given object persistent in that Block component, but
then
> I fall into a ApplicationRuntimeException (Page recorder for page ??? is
> locked after commit(), but received a change to property ... ). I think
that
> is because I use the prepareForRender(...) method to set the property ...
> but I can't use the pageBeginRender(...) because the Block are in a
foreign
> page. The only way it works now is to use the visit object, but that makes
a
> relationship between the Blocks and the Visit and I want to avoid that.
Has
> anybody a idea or a hint, or a solution from a similar situation ???
>
> Thanks for help me out ...
>
> -kai
>
> ---------------------------------------------------------------------
> 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