Hi,

I had a very similar problem today too. Sometimes the body was rendered, other times just nothing was rendered.

My workaround was to define a block containing the body part, pass this block to the "report" and have it rendered through <t:Deleget to="passedBlock" />

your report.tml would look like

        <t:loop source="items" value="row">
                <tr>
           <td> test </td>
                        <t:delegate to="passedBlock" />
                </tr>
        </t:loop>

the page would be

<t:report t:id="users" model="reportModel" row="userObject" passedBlock="innerBlock"/>
           <t:block t:id="innerBlock">
       <td>  blah blah </td>
                <td>  ${userObject.username}  </td>
        </t:block>

you'd have to define passedBlock in report.java and innerblock in page.java

like

@Inject
@Property
private Block passedBlock;

Hope this helps.
Problems like this make me nervous. I hope someone could explain why it is not working as expected.

Regards

Moritz

Am 02.06.2009 um 20:19 schrieb grabarz:

hi,
this is one of these 'mysterious' problems. i have a component (report)
which takes a datasource and draws a table filled with data. something
like a grid component provided by tapestry.

this is essencial part of .tml:

        <t:loop source="items" value="row">
                <tr>
           <td> test </td>
                        <t:body />
                </tr>
        </t:loop>

and this is part of .tml of the page which uses my component:

        <t:report t:id="users" model="reportModel" row="userObject">
       <td>  blah blah </td>
                <td>  ${userObject.username}  </td>
        </t:report>


it works perfectly ok. well, almost. sometimes it happens that
component's body is not drawn! precisely it is not returned inside
response to XHR which updates the component.

i ensured that 'items' collection is not empty (<td> test </td> is drawn correctly as many times as items.size()) and checked assigned userObject
(which is correct non-null object).

the problem is that whole the component is drawn as it should but
<t:body/> tag is _sometimes_ ignored. i cannot even reproduce this
problem easily.

there is no @BeforeRenderBody function in my component.

could you please give me a hint where should I start investigating this
problem?

thanks a lot,
m.


--
Mess with the best, die like a rest!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to