[email protected]
[Top] [All Lists]

Re: Nested component question

Subject: Re: Nested component question
From: Ron Piterman
Date: Wed, 15 Jun 2005 15:21:00 +0300
You don't have to override renderPage for that. Infact what you do is setting the property after thew page was rendered... so its a bit too late ;-)

What you should do is pass the list as a parameter, rather than as a property. Then, in your page you do:

<span jwcid="myComponent" categories="categories"/>

in the class, you implement

public List getCategories() {


××××× Vinicius Carvalho:
Hello there!
I have a page (Start.page) which has a List of categories objects.
This page has a component, with a nested component on it:

<span jwcid="@Border">
      <span jwcid="groupPanel" blockNames="ognl:user.groupList">
                <span jwcid="@CategoriesBorder"/>

User is also a property from my page. And the categoriesBorder:

<component-specification class="org.apache.tapestry.BaseComponent"
allow-body="yes" allow-informal-parameters="no">
    <property-specification name="categories" type="java.util.List">
page.categories </property-specification> </component-specification>

<span jwcid="@Foreach" source="ognl:categories" element="category">
<table border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0"
width="85%" align="center">
            <td jwcid="@Any" element="td"
bgcolor="ognl:category.color" width="30%">
            <span jwcid="@Insert" value="ognl:category.title"/>
                        <td jwcid="@Any" element="td" bgcolor="ognl:category.color" 
                        <table cellspacing="1" width="100%">
                                <td bgcolor="#FFFFFF" width="100%"> </td>

Problem is, the categories is empty, null...
The page that contains the component (Start.page) has renderPage overriden
public void renderPage(IMarkupWriter arg0, IRequestCycle arg1) {
                super.renderPage(arg0, arg1);
                TabPanel tabPanel = (TabPanel)getComponent("groupPanel");
                Group group = (Group)tabPanel.getSelectedBlock();

I've debug it and the catetories have been set properly. Any ideas?


To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

[email protected]----
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

<Prev in Thread] Current Thread [Next in Thread>