I'm about to implement a new site using Twitter Bootstrap so I've been
working on a Tapestry module to support Bootstrap. The module will be
hosted here https://github.com/trsvax/tapestry-bootstrap and will be
licensed Apache2.

I've been thinking about how to implement a MediaGrid that uses the
pagination provided by Bootstrap. In doing so I've tried to solve some
of the problems I've had with the Tapestry Grid component.
Specifically that would be use of an event to move from page to page
and the difficulty of controlling the pieces that make up the grid. So
I've come up with a design that uses Environmental and Mixins to build
the grid.

In summary the individual pieces that make up the grid get their
parameters from the environment like this

@Property
@Environmental
private PaginationEnvironment values;
        
@Parameter(value="values.currentPage",required=true)
private Integer currentPage;

There is a mixin that contains all the controlling logic and pushes
the values into the environment so you end up with a template like
this

 <t:any t:mixins="tb/pager" source="items">
      <t:tb.pagination/>
      <t:tb.mediagrid row="item">
        <a href="#123">
                        <img class="thumbnail" src="${url}"/>
                        <h3>${item.mediaTitle}</h3><button 
class="btn">+</button>
                </a>
      </t:tb.mediagrid>
      <t:tb.pagination/>
</t:any>

I've written a longer description here http://trsvax.com/blog

One question would Metadata be a better way to solve this? I've never
used that feature before. Secondly does this seem like a good
approach? And finally are there any pitfalls I have not thought of?

Thanks
Barry

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

Reply via email to