Hi,

Please see the parameter 'columnSettingsContainer' in Table (or TableView,
etc). It defines where to pick up the Blocks from.

By default that parameter points to the component where the Table is
defined. If you want it to point to the page, however, bind it to 'ognl:
page', for example. This should do what you want, I believe.

-mb


----- Original Message ----- 
From: "Nicolaas Geldenhuys" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, July 04, 2005 5:33 PM
Subject: How to override ColumnValue of table inside component


> Hi all
>
> Using tapestry 3.0.2
>
> I have successfully used the table component on a few pages and now I
> would like to create a component with common functionality that contains
> a table component.
>
> The problem is when I try to override the ColumnValue with a @Block in
> the page that uses this new component it does not seem to work.
>
> I made the component render its body but this does not seem to solve the
> problem either.
>
> Does anybody know how to solve this or is it time to look at using the
> separate TableModel etc components?
>
> .jwc File:
>
> <component-specification class="com.x.tapestry.components.SearchGrid"
>     allow-body="yes"
>     allow-informal-parameters="yes">
>
>     <description>add a description</description>
>
>     <parameter name="resultList" type="java.util.List" required="yes"
> direction="auto"  />
>     <parameter name="perfromSearchListener" direction="auto"
> type="org.apache.tapestry.IActionListener" required="yes"/>
>     <parameter name="columnList" type="java.lang.String"
> direction="in"/>
>     <parameter name="caption" type="java.lang.String" direction="in"/>
>     <parameter name="searchText" type="java.lang.String"
> direction="auto" required="yes"/>
>
>     <component id="IfResult" type="Conditional">
>         <binding name="condition" expression=" (resultList != null)
> &amp;&amp;  (resultList.size() > 0 ) "/>
>     </component>
>
>
>
>     <component id="table1" type="contrib:Table">
>
>         <inherited-binding name="columns"
> parameter-name="columnList"/>
>   <static-binding name="pageSize">900</static-binding>
>   <static-binding name="pagesDisplayed">0</static-binding>
>   <binding name="source" expression=" resultList"/>
>   </component>
>
>
> </component-specification>
>
> ----------------------------------
> .html file of component:
>
> <span jwcid="$content$">
> <span jwcid="@PageHeader" headerCaption="ognl: caption"/>
>
>     <span jwcid="@Panel" headerCaption="Search" headerContent="ognl:
> components.SearchBlock"/>
>
>      <span jwcid="IfResult">
>        <span jwcid="@Panel" headerCaption="Results" headerContent="ognl:
> components.Results"/>
>      </span>
>
>     <span jwcid="[EMAIL PROTECTED]">
>         <form jwcid="@Form">
>              Search&nbsp;<input jwcid="@TextField" value="ognl:
> searchText"/>&nbsp;&nbsp;<input jwcid="@Submit" label="Search"
> listener="ognl: perfromSearchListener"/>&nbsp;&nbsp
>         </form>
>     </span>
>
>     <span jwcid="[EMAIL PROTECTED]">
>         <table jwcid="table1" id="grid" >
>         </table>
>         <span jwcid="@RenderBody"/>
>     </span>
>  </span>
>
> ---------------------------
> Example html usage:
>
> <span jwcid="$content$">
>     <span jwcid="MainBorder">
>
>         <span jwcid="search">
>             test
>            <span jwcid="[EMAIL PROTECTED]">
>               qwerty
>           </span>
>
>        </span>
>        </span>
>  </span>
>
> --------------------------------
> Example .page
>
> <page-specification
> class="com.x.ControlCenter.tapestry.pages.LocateSimCardAccount">
>
>     <description>add a description</description>
>
>     <property-specification name="accountList" type="java.util.List"
> initial-value="null" persistent="yes"/>
>     <property-specification name="searchText" type="java.lang.String"
> initial-value="null" persistent="yes"/>
>
>     <component id="MainBorder" type="MainBorder"/>
>
>     <component id="search" type="x:SearchGrid">
>            <static-binding name="caption"  value="Locate Sim Card
> Account" />
>           <binding name="resultList" expression="accountList"/>
>           <binding name="perfromSearchListener"
> expression="listeners.Search"/>
>           <static-binding name="columnList">!Select, Voice
> Number:VoiceNumber</static-binding>
>           <binding name="searchText" expression="searchText"/>
>      </component>
>
> </page-specification>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to