You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by cqasker <cq...@yahoo.com> on 2011/09/15 19:43:07 UTC

Grid "overrides" question

So say I have a component that wraps a grid like:

SomeGrid.tml
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
xmlns:p="tapestry:parameter">
<t:form>
  
  <t:grid/>
</form>
</t:container>

SomeGrid.java
   @SuppressWarnings("unused")
   @Component(parameters={"overrides=prop:overrides", ...other params...})
   private Grid grid;

   @Parameter(value = "this", allowNull = false)
   @Property(write = false)
   private PropertyOverrides overrides;

A component that contains SomeGrid.tml and it overrides a column:
SomeGridContainer.tml
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
xmlns:p="tapestry:parameter">
  <t:someGrid>
    <p:nameCell>test Some Grid Container</p:nameCell>
  </t:someGrid>
</t:container>

SomeGridContainer.java
   @SuppressWarnings("unused")
   @Component(parameters={"overrides=prop:overrides", ...other params...})
   private SomeGrid grid;

   @Parameter(value = "this", allowNull = false)
   @Property(write = false)
   private PropertyOverrides overrides;

A page that contains SomeGridContainer
MyPage.tml
  <t:someGridContainer>
    <p:nameCell>test Page</p:nameCell>
  </t:someGridContainer>
</t:container>

In SomeGrid and SomeGridContainer I have @SupportsInformalParameters and
inject ComponentResources and pass in the overrides.

in the Name column, "test Page" always shows. I then tried and removed
p:nameCell from myPage.tml and column displayed whatever was in the name
property of the current row.  So it seems p:nameCell in SomeGridContainer is
always ignored. Is this the right behavior? It would be nice if I can get
around this since I can define column parameters in the container component
and not have to redefine them in every page I use. And for cases where I
want to override the ones in the container I can define them in the page.
Anyways interesting behavior.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-overrides-question-tp4807689p4807689.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Grid "overrides" question

Posted by cqasker <cq...@yahoo.com>.
Hmm...so publishParameters in the container component? I'll give that a shot
later today.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-overrides-question-tp4807689p4811311.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Grid "overrides" question

Posted by Steve Eynon <st...@alienfactory.co.uk>.
I'm not really sure, but I wonder if
@Component(publishParameters="...") would help anywhere?

Steve.

On 16 September 2011 01:43, cqasker <cq...@yahoo.com> wrote:
> So say I have a component that wraps a grid like:
>
> SomeGrid.tml
> <t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
> xmlns:p="tapestry:parameter">
> <t:form>
>
>  <t:grid/>
> </form>
> </t:container>
>
> SomeGrid.java
>   @SuppressWarnings("unused")
>   @Component(parameters={"overrides=prop:overrides", ...other params...})
>   private Grid grid;
>
>   @Parameter(value = "this", allowNull = false)
>   @Property(write = false)
>   private PropertyOverrides overrides;
>
> A component that contains SomeGrid.tml and it overrides a column:
> SomeGridContainer.tml
> <t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
> xmlns:p="tapestry:parameter">
>  <t:someGrid>
>    <p:nameCell>test Some Grid Container</p:nameCell>
>  </t:someGrid>
> </t:container>
>
> SomeGridContainer.java
>   @SuppressWarnings("unused")
>   @Component(parameters={"overrides=prop:overrides", ...other params...})
>   private SomeGrid grid;
>
>   @Parameter(value = "this", allowNull = false)
>   @Property(write = false)
>   private PropertyOverrides overrides;
>
> A page that contains SomeGridContainer
> MyPage.tml
>  <t:someGridContainer>
>    <p:nameCell>test Page</p:nameCell>
>  </t:someGridContainer>
> </t:container>
>
> In SomeGrid and SomeGridContainer I have @SupportsInformalParameters and
> inject ComponentResources and pass in the overrides.
>
> in the Name column, "test Page" always shows. I then tried and removed
> p:nameCell from myPage.tml and column displayed whatever was in the name
> property of the current row.  So it seems p:nameCell in SomeGridContainer is
> always ignored. Is this the right behavior? It would be nice if I can get
> around this since I can define column parameters in the container component
> and not have to redefine them in every page I use. And for cases where I
> want to override the ones in the container I can define them in the page.
> Anyways interesting behavior.
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-overrides-question-tp4807689p4807689.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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