You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Kevin C. Dorff" <kd...@kcp.com> on 2004/02/18 18:57:24 UTC

Using Table, rows per page, column's td class ?

I am changing from doing a completely custom TableView to using the new 
features in Table (using blocks). I now have the following question...

1. How do I control the number of rows per page? I don't see a parameter 
for this that I can place in the .html/.page file
2. I see valuesClass but I need difference columns to be a different 
class (or specifically set the align to right on some columns). I 
thought maybe I could somehow set the class on the block or some such 
but that doesn't change the alignment.

Thoughts?
Kevin



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


Re: Using Table, rows per page, column's td class ?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 18, 2004, at 12:57 PM, Kevin C. Dorff wrote:
> I am changing from doing a completely custom TableView to using the 
> new features in Table (using blocks). I now have the following 
> question...
>
> 1. How do I control the number of rows per page? I don't see a 
> parameter for this that I can place in the .html/.page file

Yeah, this is something I've been meaning to address.  We do need to 
expose the rows per page attribute up a level higher to Table.jwc.  I 
did this with one other attribute before.  I'll see about taking care 
of this if MB doesn't beat me to it.

> 2. I see valuesClass but I need difference columns to be a different 
> class (or specifically set the align to right on some columns). I 
> thought maybe I could somehow set the class on the block or some such 
> but that doesn't change the alignment.

I haven't looked into this, but I suspect we need to do a bit more with 
CSS pass-through somehow.

	Erik


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


Re: Using Table, rows per page, column's td class ?

Posted by "Kevin C. Dorff" <kd...@kcp.com>.
Thanks, these helped!

Kevin

Mindbridge wrote:

>Hi,
>
>  
>
>>1. How do I control the number of rows per page? I don't see a parameter
>>for this that I can place in the .html/.page file
>>    
>>
>
>It is in the table state. Something like this, perhaps:
>    objTableModel.getPagingState().setPageSize(50);
>This is probably something that has to be made a parameter as well when the
>source/columns approach is used.
>
>  
>
>>2. I see valuesClass but I need difference columns to be a different
>>class (or specifically set the align to right on some columns). I
>>thought maybe I could somehow set the class on the block or some such
>>but that doesn't change the alignment.
>>    
>>
>
>valuesClass can be an expression, for example it can invoke the
>getValuesClass() method by setting it to "ognl:valuesClass".
>You can obtain the current column either by using the 'column' parameter of
>TableValues (if you use the lower level components) or Table. You can also
>obtain it by invoking getTableColumn() on either of the two.
>Once you have the column, you can decide what to return in getValuesClass().
>
>Hope this helps.
>-mb
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>



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


Re: Using Table, rows per page, column's td class ?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 20, 2004, at 12:08 PM, Kevin C. Dorff wrote:
> That would be a great solution. If I understand what you are saying I 
> would do it like...
>
> HTML
>    <span jwcid="dateColumnValue">
>        <span jwcid="dateColumnValueInsert"/>
>    </span>
> PAGE
>    <component id="dateColumnValue" type="Block">
>        <static-binding name="class" value="someCssClassName"/>
>    </component>


No, you cannot do it this way.  Block does not have a class parameter, 
nor should it.

I'll let MB clarify his implementation proposal.

	Erik


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


Re: Using Table, rows per page, column's td class ?

Posted by Mindbridge <mi...@yahoo.com>.
Hi,

Not quite, in the sense that you do not have to do anything at all to get
this class (no need to define a Block, etc). The class of the cell will be
what I mentioned by default, unless you override it, of course.

For example, the Table example in the Workbench renders like this on my
computer:

<td align="center" class="LanguageColumnValue">Arabic</td>

and no change of the example code was involved.

Any alternatives?

----- Original Message ----- 
From: "Kevin C. Dorff" <kd...@kcp.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, February 20, 2004 7:08 PM
Subject: Re: Using Table, rows per page, column's td class ?


> That would be a great solution. If I understand what you are saying I
> would do it like...
>
> HTML
>     <span jwcid="dateColumnValue">
>         <span jwcid="dateColumnValueInsert"/>
>     </span>
> PAGE
>     <component id="dateColumnValue" type="Block">
>         <static-binding name="class" value="someCssClassName"/>
>     </component>
>     <component id="dateColumnValueInsert" type="Insert">
>         <binding name="value"
> expression="@fmtnm.tapestry.util.Format@formatDay(currentRow.date)"/>
>     </component>
>
> Is that correct? Where the class binding could be either static or a
> non-static binding. And this would work not just for xColumnValue but
> also for xColumnHeader ... If this is what you are saying it would be a
> great solution for me.
>
> Kevin
>
> Mindbridge wrote:
>
> >I was thinking of automatically setting the class attributes to '<column
> >id>ColumnValue' and '<column id>ColumnHeader' unless valuesClass and
> >columnsClass are set. This is simpler solution, but it should do what is
> >needed in most cases, no?
> >It also has the advantage that it is not affected columns are moved
around
> >or new ones are added (something that I think is important).
> >
> >----- Original Message ----- 
> >From: "Kevin C. Dorff" <kd...@kcp.com>
> >To: "Tapestry users" <ta...@jakarta.apache.org>
> >Sent: Friday, February 20, 2004 12:32 AM
> >Subject: Re: Using Table, rows per page, column's td class ?
> >
> >
> >
> >
> >>Suggestion: How about like a comma seperated list for columns make
> >>columnsClass and valuesClass also be able to take a comma seperated list
> >>for css classes for the columns. Something like that make sense?
> >>
> >>Kevin
> >>
> >>Mindbridge wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>1. How do I control the number of rows per page? I don't see a
parameter
> >>>>for this that I can place in the .html/.page file
> >>>>
> >>>>
> >>>>
> >>>>
> >>>It is in the table state. Something like this, perhaps:
> >>>   objTableModel.getPagingState().setPageSize(50);
> >>>This is probably something that has to be made a parameter as well when
> >>>
> >>>
> >the
> >
> >
> >>>source/columns approach is used.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>2. I see valuesClass but I need difference columns to be a different
> >>>>class (or specifically set the align to right on some columns). I
> >>>>thought maybe I could somehow set the class on the block or some such
> >>>>but that doesn't change the alignment.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>valuesClass can be an expression, for example it can invoke the
> >>>getValuesClass() method by setting it to "ognl:valuesClass".
> >>>You can obtain the current column either by using the 'column'
parameter
> >>>
> >>>
> >of
> >
> >
> >>>TableValues (if you use the lower level components) or Table. You can
> >>>
> >>>
> >also
> >
> >
> >>>obtain it by invoking getTableColumn() on either of the two.
> >>>Once you have the column, you can decide what to return in
> >>>
> >>>
> >getValuesClass().
> >
> >
> >>>Hope this helps.
> >>>-mb
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: Using Table, rows per page, column's td class ?

Posted by "Kevin C. Dorff" <kd...@kcp.com>.
That would be a great solution. If I understand what you are saying I 
would do it like...

HTML
    <span jwcid="dateColumnValue">
        <span jwcid="dateColumnValueInsert"/>
    </span>
PAGE
    <component id="dateColumnValue" type="Block">
        <static-binding name="class" value="someCssClassName"/>
    </component>
    <component id="dateColumnValueInsert" type="Insert">
        <binding name="value" 
expression="@fmtnm.tapestry.util.Format@formatDay(currentRow.date)"/>
    </component>

Is that correct? Where the class binding could be either static or a 
non-static binding. And this would work not just for xColumnValue but 
also for xColumnHeader ... If this is what you are saying it would be a 
great solution for me.

Kevin

Mindbridge wrote:

>I was thinking of automatically setting the class attributes to '<column
>id>ColumnValue' and '<column id>ColumnHeader' unless valuesClass and
>columnsClass are set. This is simpler solution, but it should do what is
>needed in most cases, no?
>It also has the advantage that it is not affected columns are moved around
>or new ones are added (something that I think is important).
>
>----- Original Message ----- 
>From: "Kevin C. Dorff" <kd...@kcp.com>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Friday, February 20, 2004 12:32 AM
>Subject: Re: Using Table, rows per page, column's td class ?
>
>
>  
>
>>Suggestion: How about like a comma seperated list for columns make
>>columnsClass and valuesClass also be able to take a comma seperated list
>>for css classes for the columns. Something like that make sense?
>>
>>Kevin
>>
>>Mindbridge wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>
>>>
>>>      
>>>
>>>>1. How do I control the number of rows per page? I don't see a parameter
>>>>for this that I can place in the .html/.page file
>>>>
>>>>
>>>>        
>>>>
>>>It is in the table state. Something like this, perhaps:
>>>   objTableModel.getPagingState().setPageSize(50);
>>>This is probably something that has to be made a parameter as well when
>>>      
>>>
>the
>  
>
>>>source/columns approach is used.
>>>
>>>
>>>
>>>      
>>>
>>>>2. I see valuesClass but I need difference columns to be a different
>>>>class (or specifically set the align to right on some columns). I
>>>>thought maybe I could somehow set the class on the block or some such
>>>>but that doesn't change the alignment.
>>>>
>>>>
>>>>        
>>>>
>>>valuesClass can be an expression, for example it can invoke the
>>>getValuesClass() method by setting it to "ognl:valuesClass".
>>>You can obtain the current column either by using the 'column' parameter
>>>      
>>>
>of
>  
>
>>>TableValues (if you use the lower level components) or Table. You can
>>>      
>>>
>also
>  
>
>>>obtain it by invoking getTableColumn() on either of the two.
>>>Once you have the column, you can decide what to return in
>>>      
>>>
>getValuesClass().
>  
>
>>>Hope this helps.
>>>-mb
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>



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


Re: Using Table, rows per page, column's td class ?

Posted by Mindbridge <mi...@yahoo.com>.
I was thinking of automatically setting the class attributes to '<column
id>ColumnValue' and '<column id>ColumnHeader' unless valuesClass and
columnsClass are set. This is simpler solution, but it should do what is
needed in most cases, no?
It also has the advantage that it is not affected columns are moved around
or new ones are added (something that I think is important).

----- Original Message ----- 
From: "Kevin C. Dorff" <kd...@kcp.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, February 20, 2004 12:32 AM
Subject: Re: Using Table, rows per page, column's td class ?


> Suggestion: How about like a comma seperated list for columns make
> columnsClass and valuesClass also be able to take a comma seperated list
> for css classes for the columns. Something like that make sense?
>
> Kevin
>
> Mindbridge wrote:
>
> >Hi,
> >
> >
> >
> >>1. How do I control the number of rows per page? I don't see a parameter
> >>for this that I can place in the .html/.page file
> >>
> >>
> >
> >It is in the table state. Something like this, perhaps:
> >    objTableModel.getPagingState().setPageSize(50);
> >This is probably something that has to be made a parameter as well when
the
> >source/columns approach is used.
> >
> >
> >
> >>2. I see valuesClass but I need difference columns to be a different
> >>class (or specifically set the align to right on some columns). I
> >>thought maybe I could somehow set the class on the block or some such
> >>but that doesn't change the alignment.
> >>
> >>
> >
> >valuesClass can be an expression, for example it can invoke the
> >getValuesClass() method by setting it to "ognl:valuesClass".
> >You can obtain the current column either by using the 'column' parameter
of
> >TableValues (if you use the lower level components) or Table. You can
also
> >obtain it by invoking getTableColumn() on either of the two.
> >Once you have the column, you can decide what to return in
getValuesClass().
> >
> >Hope this helps.
> >-mb
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: Using Table, rows per page, column's td class ?

Posted by "Kevin C. Dorff" <kd...@kcp.com>.
Suggestion: How about like a comma seperated list for columns make 
columnsClass and valuesClass also be able to take a comma seperated list 
for css classes for the columns. Something like that make sense?

Kevin

Mindbridge wrote:

>Hi,
>
>  
>
>>1. How do I control the number of rows per page? I don't see a parameter
>>for this that I can place in the .html/.page file
>>    
>>
>
>It is in the table state. Something like this, perhaps:
>    objTableModel.getPagingState().setPageSize(50);
>This is probably something that has to be made a parameter as well when the
>source/columns approach is used.
>
>  
>
>>2. I see valuesClass but I need difference columns to be a different
>>class (or specifically set the align to right on some columns). I
>>thought maybe I could somehow set the class on the block or some such
>>but that doesn't change the alignment.
>>    
>>
>
>valuesClass can be an expression, for example it can invoke the
>getValuesClass() method by setting it to "ognl:valuesClass".
>You can obtain the current column either by using the 'column' parameter of
>TableValues (if you use the lower level components) or Table. You can also
>obtain it by invoking getTableColumn() on either of the two.
>Once you have the column, you can decide what to return in getValuesClass().
>
>Hope this helps.
>-mb
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>



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


Re: Using Table, rows per page, column's td class ?

Posted by Mindbridge <mi...@yahoo.com>.
Hi,

> 1. How do I control the number of rows per page? I don't see a parameter
> for this that I can place in the .html/.page file

It is in the table state. Something like this, perhaps:
    objTableModel.getPagingState().setPageSize(50);
This is probably something that has to be made a parameter as well when the
source/columns approach is used.

> 2. I see valuesClass but I need difference columns to be a different
> class (or specifically set the align to right on some columns). I
> thought maybe I could somehow set the class on the block or some such
> but that doesn't change the alignment.

valuesClass can be an expression, for example it can invoke the
getValuesClass() method by setting it to "ognl:valuesClass".
You can obtain the current column either by using the 'column' parameter of
TableValues (if you use the lower level components) or Table. You can also
obtain it by invoking getTableColumn() on either of the two.
Once you have the column, you can decide what to return in getValuesClass().

Hope this helps.
-mb


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