[Wicket-user] Setting column-widths in DataTable
Title: Setting column-widths in DataTable Hi! Is there an "elegant" way to set the column widths when using a DataTable (from wicket-extensions)? As this is a matter of design, I anticipate a solution where I can set the widths in HTML or CSS. Something like the following would be nice: Regards, Timo Verhoeven
Re: [Wicket-user] Setting column-widths in DataTable
I guess there are plenty of HTML and CSS ref and tutorial pages out there: http://www.selfhtml.org/ http://www.w3schools.com/html/ http://www.w3schools.com/css/default.asp Juergen On 4/13/06, MailingWicketUser <[EMAIL PROTECTED]> wrote: > > > > Hi! > > Is there an "elegant" way to set the column widths when using a DataTable > (from wicket-extensions)? As this is a matter of design, I anticipate a > solution where I can set the widths in HTML or CSS. Something like the > following would be nice: > > > > > > > > > Regards, > > Timo Verhoeven --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Setting column-widths in DataTable
MailingWicketUser wrote on 13.04.2006 at 11:42: > Is there an "elegant" way to set the column widths when using a > DataTable (from wicket-extensions)? As this is a matter of design, I > anticipate a solution where I can set the widths in HTML or CSS. > Something like the following would be nice: Without trying it, just looking at the source of DataTable, I'm confident that you can define your widths just like that :) > > > > > > But I'm just a beginning wicket user as well, so maybe your colgroup tags are just ignored in the rendered ouput. Then you'd have to use CSS as Juergen mentioned, or make a subclass of DataTable and provide your own HTML for it. -- greetings from Berlin, Rüdiger Schulz --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
AW: [Wicket-user] Setting column-widths in DataTable
Thank's for you feedback! Skimming thru the javadocs of the DataTable classes I overlooked the newCellItem method in DataTable. Overwriting this I can now add css-class attributes to the td tags using the following code: DataTable dataTable = new DataTable("table", columns, dataProvider, rowsPerPage) { protected Item newCellItem(String id, int index, IModel model) { Item item = new Item(id, index, model); item.add(new SimpleAttributeModifier("class", "col" + index)); return item; } }; Regards, Timo Verhoeven -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Juergen Donnerstag Bereitgestellt: Donnerstag, 13. April 2006 11:58 Bereitgestellt in: User Unterhaltung: [Wicket-user] Setting column-widths in DataTable Betreff: Re: [Wicket-user] Setting column-widths in DataTable I guess there are plenty of HTML and CSS ref and tutorial pages out there: http://www.selfhtml.org/ http://www.w3schools.com/html/ http://www.w3schools.com/css/default.asp Juergen On 4/13/06, MailingWicketUser <[EMAIL PROTECTED]> wrote: > > > > Hi! > > Is there an "elegant" way to set the column widths when using a > DataTable (from wicket-extensions)? As this is a matter of design, I > anticipate a solution where I can set the widths in HTML or CSS. > Something like the following would be nice: > > > > > > > > > Regards, > > Timo Verhoeven --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
AW: [Wicket-user] Setting column-widths in DataTable
For the records: My first approach worked well until the DataTable hit an empty list. In that case, newCellItem is never called as there is no data to be displayed. Hence the still visible table headers had wrong widths. I had to create a copy of HeadersToolbar and add the line header.add(new SimpleAttributeModifier("class", "col" + i)); Now I can apply the css width settings to the th tags. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von MailingWicketUser Bereitgestellt: Donnerstag, 13. April 2006 13:30 Bereitgestellt in: User Unterhaltung: [Wicket-user] Setting column-widths in DataTable Betreff: AW: [Wicket-user] Setting column-widths in DataTable Thank's for you feedback! Skimming thru the javadocs of the DataTable classes I overlooked the newCellItem method in DataTable. Overwriting this I can now add css-class attributes to the td tags using the following code: DataTable dataTable = new DataTable("table", columns, dataProvider, rowsPerPage) { protected Item newCellItem(String id, int index, IModel model) { Item item = new Item(id, index, model); item.add(new SimpleAttributeModifier("class", "col" + index)); return item; } }; Regards, Timo Verhoeven -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Juergen Donnerstag Bereitgestellt: Donnerstag, 13. April 2006 11:58 Bereitgestellt in: User Unterhaltung: [Wicket-user] Setting column-widths in DataTable Betreff: Re: [Wicket-user] Setting column-widths in DataTable I guess there are plenty of HTML and CSS ref and tutorial pages out there: http://www.selfhtml.org/ http://www.w3schools.com/html/ http://www.w3schools.com/css/default.asp Juergen On 4/13/06, MailingWicketUser <[EMAIL PROTECTED]> wrote: > > > > Hi! > > Is there an "elegant" way to set the column widths when using a > DataTable (from wicket-extensions)? As this is a matter of design, I > anticipate a solution where I can set the widths in HTML or CSS. > Something like the following would be nice: > > > > > > > > > Regards, > > Timo Verhoeven --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user