You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Inge Solvoll <ta...@ingenett.com> on 2005/11/11 12:57:42 UTC

contrib:TableColumns - How to apply alignment and style?

I'm using the table component from contrib, and I'm not able to set the 
style I want on the column headers. They seem to be fixed at 
align=center and without the possibility of setting a custom css class 
on the link displayed.

I guess this is trivial, using some renderer, but I have spent some time 
trying to figure it out now, without success. Could anyone help me?

Here is an extract of my code:

-----------------------------------
.page
-----------------------------------

<page-specification class="mypackage.UserList">
	<description>
		popup to show a list of users
	</description>
	
	<property-specification name="users" type="java.util.List" 
persistent="yes"/>
	<property-specification name="currentRow" type="mypackage.SearchHit"/>
	<property-specification name="selectedPage" type="java.lang.String" 
initial-value="pageName"/>
   <property-specification name="currentColumn" 
type="mypackage.DefaultTableColumn"/>
	
	<component id="listedUsers" type="contrib:TableView">
		<binding name="source" expression="users"/>
		<binding name="columns" expression="'name:Name:name, 
division:Division:division, email:Email:email'"/>
		<binding name="pageSize" expression="11"/>
	</component>
</page-specification>

-----------------------------------------
.html
------------------------------------------

		<table jwcid="listedUsers"  style="width: 400px; padding-left: 5px">
			<col style="width: 250px" />
			<th jwcid="@contrib:TableColumns" element="th"/>
			<tr jwcid="@contrib:TableRows"  row="ognl:currentRow" >
	            <span jwcid="@contrib:TableValues" class="body-text" />
	        </tr>
			<tr jwcid="$remove$"> <td>Albert **</td><td>Oslo **</td></tr>
			<tr jwcid="$remove$"> <td>Hans Hansen **</td><td>Bergen **</td></tr>
			<tfoot>
	  			<tr>
	            	<td colspan="4" style="text-align: center" class="body-text">
	            		<span jwcid="@tapfx:DetailedTablePages"   />
	                </td>
	         	</tr>
	        </tfoot>
		</table>

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


new version of Tapestry Palette released

Posted by Lindsay Steele <ls...@iinet.net.au>.
I hope this is not bad form - but I noticed that a new version of 
Tapestry Palette has been released that is compatible with the latest 
versions of spindle and eclipse.    I downloaded it last night and it 
seems to work well - good to have it useful again.  It is a great little 
plugin to have.

http://tapestrypalette.mjhenderson.com/


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


Re: contrib:TableColumns - How to apply alignment and style?

Posted by Ingvald Skaug <in...@gmail.com>.
hi,

On Fri, 11 Nov 2005 19:53:34 +0200, Mind Bridge
<mi...@yahoo.com> wrote:

>Inge Solvoll wrote:

>> I'm using the table component from contrib, and I'm not able to set 
>> the style I want on the column headers. They seem to be fixed at 
>> align=center and without the possibility of setting a custom css class 
>> on the link displayed.
....

>try something like the following in your CSS:
>.<id>ColumnHeader table { align: left; width: 100%; }
>where <id> is your column 
....

setting the width did the trick.

the component renders a column header using a separate table
"floating" by itself, so nothing much could touch it in the case of
alignment.  but setting the width to 100% helped. 

thanks,
ingvald


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


Re: contrib:TableColumns - How to apply alignment and style?

Posted by Mind Bridge <mi...@yahoo.com>.
Hi,

try something like the following in your CSS:

.<id>ColumnHeader table { align: left; width: 100%; }

where <id> is your column, or:

.columnsClass table { align: left; width: 100%; }

for all columns. Basically you can use whatever CSS you want that way.

Inge Solvoll wrote:
> I'm using the table component from contrib, and I'm not able to set 
> the style I want on the column headers. They seem to be fixed at 
> align=center and without the possibility of setting a custom css class 
> on the link displayed.
>
> I guess this is trivial, using some renderer, but I have spent some 
> time trying to figure it out now, without success. Could anyone help me?
>
> Here is an extract of my code:
>
> -----------------------------------
> .page
> -----------------------------------
>
> <page-specification class="mypackage.UserList">
>     <description>
>         popup to show a list of users
>     </description>
>     
>     <property-specification name="users" type="java.util.List" 
> persistent="yes"/>
>     <property-specification name="currentRow" 
> type="mypackage.SearchHit"/>
>     <property-specification name="selectedPage" 
> type="java.lang.String" initial-value="pageName"/>
>   <property-specification name="currentColumn" 
> type="mypackage.DefaultTableColumn"/>
>     
>     <component id="listedUsers" type="contrib:TableView">
>         <binding name="source" expression="users"/>
>         <binding name="columns" expression="'name:Name:name, 
> division:Division:division, email:Email:email'"/>
>         <binding name="pageSize" expression="11"/>
>     </component>
> </page-specification>
>
> -----------------------------------------
> .html
> ------------------------------------------
>
>         <table jwcid="listedUsers"  style="width: 400px; padding-left: 
> 5px">
>             <col style="width: 250px" />
>             <th jwcid="@contrib:TableColumns" element="th"/>
>             <tr jwcid="@contrib:TableRows"  row="ognl:currentRow" >
>                 <span jwcid="@contrib:TableValues" class="body-text" />
>             </tr>
>             <tr jwcid="$remove$"> <td>Albert **</td><td>Oslo **</td></tr>
>             <tr jwcid="$remove$"> <td>Hans Hansen **</td><td>Bergen 
> **</td></tr>
>             <tfoot>
>                   <tr>
>                     <td colspan="4" style="text-align: center" 
> class="body-text">
>                         <span jwcid="@tapfx:DetailedTablePages"   />
>                     </td>
>                  </tr>
>             </tfoot>
>         </table>
>
> ---------------------------------------------------------------------
> 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: contrib:TableColumns - How to apply alignment and style?

Posted by Jonathan O'Connor <Jo...@xcom.de>.
Inge,
Somebody (probably MindBridge) passed this tip on to me a while ago.
Extract SimpleTableColumnComponent.html from the Tapestry-contrib jar.
Make any alterations you want, and then stick it in your WAR file. The path
has to be:
      WEB-INF/classes/org/apache/tapestry/contrib/components/inserted

This trick works for all contrib and standard components. Simple when you
know how!

BTW, here's my version of the file. I use css to align the text
appropriately.
<span jwcid="$content$">

<span jwcid="condSorted">
      <a jwcid="linkColumn"><span jwcid="insertSortedColumn"/></a>
      <span jwcid="condSort"><span jwcid="imageSort"/></span>
</span>

<span jwcid="condNotSorted">
      <span jwcid="insertNotSortedColumn"/>
</span>

</span>

Ciao,
Jonathan O'Connor
XCOM Dublin


                                                                           
             Inge Solvoll                                                  
             <tapestry@ingenet                                             
             t.com>                                                     To 
                                       Tapestry users                      
             11/11/2005 11:57          <ta...@jakarta.apache.org>  
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             "Tapestry users"          contrib:TableColumns - How to apply 
             <tapestry-user@ja         alignment and style?                
             karta.apache.org>                                             
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




I'm using the table component from contrib, and I'm not able to set the
style I want on the column headers. They seem to be fixed at
align=center and without the possibility of setting a custom css class
on the link displayed.

I guess this is trivial, using some renderer, but I have spent some time
trying to figure it out now, without success. Could anyone help me?

Here is an extract of my code:

-----------------------------------
.page
-----------------------------------

<page-specification class="mypackage.UserList">
             <description>
                         popup to show a list of users
             </description>

             <property-specification name="users" type="java.util.List"
persistent="yes"/>
             <property-specification name="currentRow"
type="mypackage.SearchHit"/>
             <property-specification name="selectedPage"
type="java.lang.String"
initial-value="pageName"/>
   <property-specification name="currentColumn"
type="mypackage.DefaultTableColumn"/>

             <component id="listedUsers" type="contrib:TableView">
                         <binding name="source" expression="users"/>
                         <binding name="columns"
expression="'name:Name:name,
division:Division:division, email:Email:email'"/>
                         <binding name="pageSize" expression="11"/>
             </component>
</page-specification>

-----------------------------------------
.html
------------------------------------------

                         <table jwcid="listedUsers"  style="width: 400px;
padding-left: 5px">
                                     <col style="width: 250px" />
                                     <th jwcid="@contrib:TableColumns"
element="th"/>
                                     <tr jwcid="@contrib:TableRows"
row="ognl:currentRow" >
                         <span jwcid="@contrib:TableValues"
class="body-text" />
                     </tr>
                                     <tr jwcid="$remove$"> <td>Albert
**</td><td>Oslo **</td></tr>
                                     <tr jwcid="$remove$"> <td>Hans Hansen
**</td><td>Bergen **</td></tr>
                                     <tfoot>
                                                 <tr>
                                     <td colspan="4" style="text-align:
center" class="body-text">
                                                 <span
jwcid="@tapfx:DetailedTablePages"   />
                             </td>
                               </tr>
                     </tfoot>
                         </table>

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





*** XCOM AG Legal Disclaimer ***

Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist allein
für den Gebrauch durch den vorgesehenen Empfaenger bestimmt. Dritten ist
das Lesen, Verteilen oder Weiterleiten dieser E-Mail untersagt. Wir bitten,
eine fehlgeleitete E-Mail unverzueglich vollstaendig zu loeschen und uns
eine Nachricht zukommen zu lassen.

This email may contain material that is confidential and for the sole use
of the intended recipient. Any review, distribution by others or forwarding
without express permission is strictly prohibited. If you are not the
intended recipient, please contact the sender and delete all copies.

Hauptsitz: Bahnstrasse 33, D-47877 Willich, USt-IdNr.: DE 812 885 664
Kommunikation: Telefon +49 2154 9209-70, Telefax +49 2154 9209-900,
www.xcom.de
Handelsregister: Amtsgericht Krefeld, HRB 10340
Vorstand: Matthias Albrecht, Renate Becker-Grope, Marco Marty
Vorsitzender des Aufsichtsrates: Stephan Steuer