So this is a follow-up:

I've gotten it mostly working but for some reason the defaults on my
component are not overriding the defaults in the original grid component.
Not sure why. So here are the relevant parts:

My page:
<html t:type="layout"
 xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
  <t:form t:id="loginForm" class="full-form">
    <t:grid.MyGrid source="source" inPlace="true">
      <p:empty>
         <p>There are no items to display; you can add some.</p>
      </p:empty>       
    </t:grid.MyGrid>   
</html>

MyGrid component tml:
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
xmlns:p="tapestry:parameter">
   <div t:type="Grid" source="inherit:source"
                      rowsPerPage="inherit:rowsPerPage"
                      pagerPosition="inherit:pagerPosition"
                      row="inherit:row"
                      columnIndex="inherit:columnIndex"
                      model="inherit:model"
                      sortModel="inherit:sortModel"
                      add="inherit:add"
                      include="inherit:include"
                      exclude="inherit:exclude"
                      reorder="inherit:reorder"
                      empty="inherit:empty"
                      tableClass="inherit:tableClass"
                      inPlace="inherit:inPlace">
   
   </div>
</t:container>

MyGrid class (just relevant parts):
@SuppressWarnings("unused")
@SupportsInformalParameters
public class MyGrid
{
   
   @Parameter(required = true, autoconnect = true)
   private GridDataSource source;

   @Parameter("75") //Grid.java has a default of 25
   private int rowsPerPage;
 
   ...rest is pretty much a copy of Grid.java from Tapestry source.
}

Problem is my table is doing 25 rows per page (Grid's default) and not the
default I set above, 75. 
I read:
http://tapestry.apache.org/component-parameters.html#ComponentParameters-InheritedParameterBindings
and it states that:

"Inherited bindings are useful for complex components; they are often used
when an inner component has a default value for a parameter, and the outer
component wants to make it possible to override that default."

which is why I am using the inherited: prefix for my bindings. I am still at
a loss as to why my default is not being used. Anyone have any ideas why?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Creating-Components-composed-of-other-components-tp4734888p4736044.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to