You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Markus Wiederkehr <as...@fantasymail.de> on 2004/10/04 11:20:52 UTC

contrib:Table issues

I have some questions and suggestions about contrib:Table...

1) <table> tag inside <th>

When a table header is sortable Tapestry creates an inner table for the
caption and the icon. That table uses the attributes 'border=0
cellspacing=0 cellpadding=0'. The values of these attributes should be
quoted to be XML conform.

See inserted/SimpleTableColumnComponent.html

2) <table> tag inside <th> (2)

Wouldn't it be better to remove the inner table entirely? The alignment
problems can be resolved with CSS in a better way.

3) When I click on a sorting column or navigate to another page of the
table the method TableView.getTableModel() gets invoked twice. The first
invocation occurs through
SimpleTableColumnComponent.columnSelected() or TablePages.changePage(),
respectively. The second invocation is caused by
TableView.renderComponent().

I was able to work around that issue by caching the table model in a page property. But I think it would be better if the framework could handle this.

Markus


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


Re: contrib:Table issues

Posted by Markus Wiederkehr <as...@fantasymail.de>.
On Mon, 2004-10-04 at 21:45, Erik Hatcher wrote:
> On Oct 4, 2004, at 5:20 AM, Markus Wiederkehr wrote:
> > I have some questions and suggestions about contrib:Table...
> >
> > 1) <table> tag inside <th>
> >
> > When a table header is sortable Tapestry creates an inner table for the
> > caption and the icon. That table uses the attributes 'border=0
> > cellspacing=0 cellpadding=0'. The values of these attributes should be
> > quoted to be XML conform.
> >
> > See inserted/SimpleTableColumnComponent.html
> >
> > 2) <table> tag inside <th> (2)
> >
> > Wouldn't it be better to remove the inner table entirely? The alignment
> > problems can be resolved with CSS in a better way.
> 
> I, too, have noticed these issues.  These can be worked around by 
> _overriding_ the HTML templates.  The trick is finding the afflicted 
> templates (within the Tapestry contrib JAR), note the full package 
> name, then place the same named file in your WEB-INF/classes directory, 
> preserving the package naming structure.  Your new templates will be 
> used instead.  (I don't have the exact names or source code in front of 
> me at the moment, so don't have the precise filenames in front of me)

I'll give it a try, thanks for the hint.

> > 3) When I click on a sorting column or navigate to another page of the
> > table the method TableView.getTableModel() gets invoked twice. The 
> > first
> > invocation occurs through
> > SimpleTableColumnComponent.columnSelected() or TablePages.changePage(),
> > respectively. The second invocation is caused by
> > TableView.renderComponent().
> 
> Again, I don't have the details handy, but  one trick is to do lazy 
> initialization and keeping the model around the first time it is 
> invoked within a member variable - then the second call to get the 
> model is very fast.

As I wrote yesterday I was able to work around the problem by caching
the table model in a page property. Like this:

  <property-specification name="usersCache" type="java.util.Set"/>

  public Set getUsers()
  {
    Set result = getUsersCache();
    if (result == null)
    {
      result = SecurityDelegate.getAllUsers(this);
      setUsersCache(result);
    }
    return result;
  }

  public abstract Set getUsersCache();
  public abstract void setUsersCache(Set set);

Anyway, I still believe that this is something that should be handled by
the framework, not by me.


Markus


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


Re: contrib:Table issues

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Oct 4, 2004, at 5:20 AM, Markus Wiederkehr wrote:
> I have some questions and suggestions about contrib:Table...
>
> 1) <table> tag inside <th>
>
> When a table header is sortable Tapestry creates an inner table for the
> caption and the icon. That table uses the attributes 'border=0
> cellspacing=0 cellpadding=0'. The values of these attributes should be
> quoted to be XML conform.
>
> See inserted/SimpleTableColumnComponent.html
>
> 2) <table> tag inside <th> (2)
>
> Wouldn't it be better to remove the inner table entirely? The alignment
> problems can be resolved with CSS in a better way.

I, too, have noticed these issues.  These can be worked around by 
_overriding_ the HTML templates.  The trick is finding the afflicted 
templates (within the Tapestry contrib JAR), note the full package 
name, then place the same named file in your WEB-INF/classes directory, 
preserving the package naming structure.  Your new templates will be 
used instead.  (I don't have the exact names or source code in front of 
me at the moment, so don't have the precise filenames in front of me)

> 3) When I click on a sorting column or navigate to another page of the
> table the method TableView.getTableModel() gets invoked twice. The 
> first
> invocation occurs through
> SimpleTableColumnComponent.columnSelected() or TablePages.changePage(),
> respectively. The second invocation is caused by
> TableView.renderComponent().

Again, I don't have the details handy, but  one trick is to do lazy 
initialization and keeping the model around the first time it is 
invoked within a member variable - then the second call to get the 
model is very fast.

	Erik


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