Re: [Wicket-user] DataTable header manipulation

2006-11-08 Thread dulanov

I added a class check to the first header th element by next code:


issues = new DataTable(issues, columns.toArray(new
IColumn[columns.size()]), issueListProvider, itemsPerPage) {

@Override protected Item newRowItem(String id, int index, IModel
model) {
return new OddEvenItem(id, index, model);
}
};
issues.addTopToolbar(new IssueHeadersToolbar(issues,
issueListProvider));
...

public static class IssueHeadersToolbar extends HeadersToolbar {

public IssueHeadersToolbar(DataTable table, ISortStateLocator
stateLocator) {
super(table, stateLocator);

RepeatingView headers = (RepeatingView) get(headers);
MarkupContainer checkColumn = (MarkupContainer)
((MarkupContainer) headers.get(1)).get(header);
checkColumn.add(new AttributeModifier(class, true, new
Model(check)));
}
}

Is it possible to simplify?


Stefan Lindner wrote:
 
 I can manipulate the data grip part of a DataTable by overriding
 newCellItem. But if I e.g. need a speical layout for the table header, I
 must add a class or id attribute to the th elements of the headline
 (different layout on the left and right side e.g.).
 I can see no way to manipulate the generation of the headline. O.K. I can
 design my own Toolbar according to HeadersToolbar but in most cases that's
 much too compülicated. Is there an easy way to control the generation of
 the table head?
  
 Stefan Lindner
 
  
 -
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net's Techsay panel and you'll get the chance to share
 your
 opinions on IT  business topics through brief surveys -- and earn cash
 http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/DataTable-header-manipulation-tf2397492.html#a7237234
Sent from the Wicket - User mailing list archive at Nabble.com.


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-11-08 Thread dulanov

I added a class check to the first header th element by next code:

ListIColumn columns = new ArrayListIColumn();
columns.add(new AbstractColumn(new Model()) {

@Override public Component getHeader(String componentId) {
return new IssueSelectionFragment(componentId,
checkBoxFrag, IssueTabular.this, new Issue());
}

public void populateItem(Item cellItem, String componentId,
IModel rowModel) {
setModel(rowModel);
Issue issue = (Issue) getModelObject();
cellItem.add(new IssueSelectionFragment(componentId,
checkBoxFrag, IssueTabular.this, issue));
cellItem.add(new AttributeModifier(class, true, new
Model(check)));
}
});

issues = new DataTable(issues, columns.toArray(new
IColumn[columns.size()]), issueListProvider, itemsPerPage) {

@Override protected Item newRowItem(String id, int index, IModel
model) {
return new OddEvenItem(id, index, model);
}
};
issues.addTopToolbar(new IssueHeadersToolbar(issues,
issueListProvider));
...

public static class IssueHeadersToolbar extends HeadersToolbar {

public IssueHeadersToolbar(DataTable table, ISortStateLocator
stateLocator) {
super(table, stateLocator);

RepeatingView headers = (RepeatingView) get(headers);
MarkupContainer checkColumn = (MarkupContainer)
((MarkupContainer) headers.get(1)).get(header);
checkColumn.add(new AttributeModifier(class, true, new
Model(check)));
}
}

Is it possible to simplify?


Stefan Lindner wrote:
 
 I can manipulate the data grip part of a DataTable by overriding
 newCellItem. But if I e.g. need a speical layout for the table header, I
 must add a class or id attribute to the th elements of the headline
 (different layout on the left and right side e.g.).
 I can see no way to manipulate the generation of the headline. O.K. I can
 design my own Toolbar according to HeadersToolbar but in most cases that's
 much too compülicated. Is there an easy way to control the generation of
 the table head?
  
 Stefan Lindner
 
  
 -
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net's Techsay panel and you'll get the chance to share
 your
 opinions on IT  business topics through brief surveys -- and earn cash
 http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/DataTable-header-manipulation-tf2397492.html#a7237245
Sent from the Wicket - User mailing list archive at Nabble.com.


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-11-08 Thread dulanov

After same experiments I stop by following:

public static final class IssueHeadersToolbar extends HeadersToolbar {

public IssueHeadersToolbar(DataTable table, ISortStateLocator
stateLocator) {
super(table, stateLocator);
get(headers:1:header).add(new AttributeModifier(class, true,
new Model(check)));
}
}

But, this isn't supportable solution ;(


dulanov wrote:
 
 I added a class check to the first header th element by next code:
 
 ListIColumn columns = new ArrayListIColumn();
 columns.add(new AbstractColumn(new Model()) {
 
 @Override public Component getHeader(String componentId) {
 return new IssueSelectionFragment(componentId,
 checkBoxFrag, IssueTabular.this, new Issue());
 }
 
 public void populateItem(Item cellItem, String componentId,
 IModel rowModel) {
 setModel(rowModel);
 Issue issue = (Issue) getModelObject();
 cellItem.add(new IssueSelectionFragment(componentId,
 checkBoxFrag, IssueTabular.this, issue));
 cellItem.add(new AttributeModifier(class, true, new
 Model(check)));
 }
 });
 
 issues = new DataTable(issues, columns.toArray(new
 IColumn[columns.size()]), issueListProvider, itemsPerPage) {
 
 @Override protected Item newRowItem(String id, int index,
 IModel model) {
 return new OddEvenItem(id, index, model);
 }
 };
 issues.addTopToolbar(new IssueHeadersToolbar(issues,
 issueListProvider));
 ...
 
 public static class IssueHeadersToolbar extends HeadersToolbar {
 
 public IssueHeadersToolbar(DataTable table, ISortStateLocator
 stateLocator) {
 super(table, stateLocator);
 
 RepeatingView headers = (RepeatingView) get(headers);
 MarkupContainer checkColumn = (MarkupContainer)
 ((MarkupContainer) headers.get(1)).get(header);
 checkColumn.add(new AttributeModifier(class, true, new
 Model(check)));
 }
 }
 
 Is it possible to simplify?
 
 
 Stefan Lindner wrote:
 
 I can manipulate the data grip part of a DataTable by overriding
 newCellItem. But if I e.g. need a speical layout for the table header, I
 must add a class or id attribute to the th elements of the headline
 (different layout on the left and right side e.g.).
 I can see no way to manipulate the generation of the headline. O.K. I can
 design my own Toolbar according to HeadersToolbar but in most cases
 that's much too compülicated. Is there an easy way to control the
 generation of the table head?
  
 Stefan Lindner
 
  
 -
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net's Techsay panel and you'll get the chance to share
 your
 opinions on IT  business topics through brief surveys -- and earn cash
 http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/DataTable-header-manipulation-tf2397492.html#a7239447
Sent from the Wicket - User mailing list archive at Nabble.com.


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-07 Thread Leszek Gawron
Igor Vaynberg wrote:
 what if you have two datatables on a page? then your ids are no longer 
 unique.

that is why classes should be used...

-- 
Leszek Gawron

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] DataTable header manipulation

2006-10-06 Thread Stefan Lindner
I can manipulate the data grip part of a DataTable by overriding newCellItem. 
But if I e.g. need a speical layout for the table header, I must add a class or 
id attribute to the th elements of the headline (different layout on the left 
and right side e.g.).
I can see no way to manipulate the generation of the headline. O.K. I can 
design my own Toolbar according to HeadersToolbar but in most cases that's much 
too compülicated. Is there an easy way to control the generation of the table 
head?
 
Stefan Lindner
winmail.dat-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-06 Thread Leszek Gawron
Stefan Lindner wrote:
 I can manipulate the data grip part of a DataTable by overriding newCellItem. 
 But if I e.g. need a speical layout for the table header, I must add a class 
 or id attribute to the th elements of the headline (different layout on the 
 left and right side e.g.).
 I can see no way to manipulate the generation of the headline. O.K. I can 
 design my own Toolbar according to HeadersToolbar but in most cases that's 
 much too compülicated. Is there an easy way to control the generation of the 
 table head?
  
 Stefan Lindner
I keep having exactly the same problems. DataTable components do not 
carry any css classes so any visual customization/layout is hardly possible.

-- 
Leszek Gawron

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-06 Thread Gwyn Evans
I'm not sure about Stefan's requirements, but doesn't the
table.class  thead  tr.headers  th hierarchy let you target the
header sufficiently?

/Gwyn

On 06/10/06, Leszek Gawron [EMAIL PROTECTED] wrote:
 Stefan Lindner wrote:
  I can manipulate the data grip part of a DataTable by overriding 
  newCellItem. But if I e.g. need a speical layout for the table header, I 
  must add a class or id attribute to the th elements of the headline 
  (different layout on the left and right side e.g.).
  I can see no way to manipulate the generation of the headline. O.K. I can 
  design my own Toolbar according to HeadersToolbar but in most cases that's 
  much too compülicated. Is there an easy way to control the generation of 
  the table head?
 
  Stefan Lindner
 I keep having exactly the same problems. DataTable components do not
 carry any css classes so any visual customization/layout is hardly possible.

 --
 Leszek Gawron

-- 
Download Wicket 1.2.2 now! - http://wicketframework.org

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-06 Thread Igor Vaynberg
when i look at the markup of the headers toolbar i seewicket:panel tr class=headers  span wicket:id=headers   th wicket:id=headerspan wicket:id=labelnbsp;/span/th
  /span /tr/wicket:panelthat is, i see that the tr carries a class, and the th carries a class. if there is a sortable header then those also carry classes.have you seen the demo of the datatable in examples? it is fully styled.
where else would you want me to add css classes?-IgorOn 10/6/06, Leszek Gawron [EMAIL PROTECTED]
 wrote:Stefan Lindner wrote: I can manipulate the data grip part of a DataTable by overriding newCellItem. But if I 
e.g. need a speical layout for the table header, I must add a class or id attribute to the th elements of the headline (different layout on the left and right side e.g.). I can see no way to manipulate the generation of the headline. 
O.K. I can design my own Toolbar according to HeadersToolbar but in most cases that's much too compülicated. Is there an easy way to control the generation of the table head? Stefan LindnerI keep having exactly the same problems. DataTable components do not
carry any css classes so any visual customization/layout is hardly possible.--Leszek Gawron-Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-06 Thread Leszek Gawron
Gwyn Evans wrote:
 I'm not sure about Stefan's requirements, but doesn't the
 table.class  thead  tr.headers  th hierarchy let you target the
 header sufficiently?

e.g. it does not allow me to specify column widths. If every column had 
it's id appended as class like:

th class=column-namename/thth class=column-actionsactions/th

I could set style for column actions to 'width: 1px; white-space: 
nowrap' so it occupies the least space.

This is only a simple use case I got into yesterday.

Same goes for filters toolbar and paging toolbar. In order to do any 
real customization I had to extend the classed and use AttributeAppender 
to set class attribute so the markup is customizable by css.

 public class StyledGoFilter extends GoFilter {
   public StyledGoFilter( String id ) {
   super( id, new Model( filtruj ) );
   getGoButton().add( new AttributeAppender( class, new Model( 
 button ), ; ) );
   add( new AttributeAppender( style, new Model( width: 1px ), 
 ; ) );
   }
 }

 public class StyledTextFilter extends TextFilter {
 
   public StyledTextFilter( String id, IModel model, FilterForm form ) {
   super( id, model, form );
   getFilter().add( new AttributeAppender( style, new Model( 
 width: 99% ), ; ) );
   }
 
 }

Of course the code uses 'class' attributes, I have changed it for the 
example.

I would like to work with single header/column/input in css instead of 
modifying them all at once. Having dynamic class names for every th/td 
in columns allows you to target particular cells.


BTW is there any way to change the paging navigator so it uses something 
else than   ? My users say   gets unreadable.


I'm fairly new to wicket so plase bear my stupidity with patience :)

-- 
Leszek Gawron

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-06 Thread Stefan Lindner
If you want to have the first column of a table in a special layout or the 
last, a special css treatment is needed. In this cases it is very helpful to 
have an id-attribute in the td tag. So I overwrite cellContainer
 
 
@Override

protected Item newCellItem(MarkupContainer cellContainer, final String id, int 
index, final IModel model) {

cellContainer.add(new AttributeModifier(id, true, new 
ModelString(BLAFASELTRALALA)));

Item item = new Item(cellContainer, id, index, model);

int columns = getColumns().length;

String idAttribute = single;

if (columns  1) {

if (index == 0)

idAttribute = left;

else if (index == columns - 1)

idAttribute = right;

else

idAttribute = middle;

}

item.add(new AttributeModifier(id, true, new ModelString(idAttribute)));

return item;

}

 

 

 

And each cell is marked as left, middle or right or single if the table 
has only on column. Now I can easily do things like this in css:

#left { border-left: 2px solid rgb(34,69,104);
}

To complete the appearence, it would be nice to have the same thing for the 
table header. Yes, of cource, I saw the examle cde and the resulting tables 
look very pretty, but the customer's whish

I think, the integration of something like the above code would help some 
people (see Leszek Gawron's reply)

 

Stefan Lindner


winmail.dat-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-06 Thread Igor Vaynberg
what if you have two datatables on a page? then your ids are no longer unique.On 10/6/06, Stefan Lindner [EMAIL PROTECTED]
 wrote:If you want to have the first column of a table in a special layout or the last, a special css treatment is needed. In this cases it is very helpful to have an id-attribute in the td tag. So I overwrite cellContainer
@Overrideprotected Item newCellItem(MarkupContainer cellContainer, final String id, int index, final IModel model) {cellContainer.add(new AttributeModifier(id, true, new ModelString(BLAFASELTRALALA)));
Item item = new Item(cellContainer, id, index, model);int columns = getColumns().length;String idAttribute = single;if (columns  1) {if (index == 0)idAttribute = left;
else if (index == columns - 1)idAttribute = right;elseidAttribute = middle;}item.add(new AttributeModifier(id, true, new ModelString(idAttribute)));
return item;}And each cell is marked as left, middle or right or single if the table has only on column. Now I can easily do things like this in css:
#left { border-left: 2px solid rgb(34,69,104);}To complete the appearence, it would be nice to have the same thing for the table header. Yes, of cource, I saw the examle cde and the resulting tables look very pretty, but the customer's whish
I think, the integration of something like the above code would help some people (see Leszek Gawron's reply)Stefan Lindner-
Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-06 Thread Stefan Lindner
I think there are two cases:
1. Improve the look of all tables generated by DefaultDataTable
   This can be done by adding id and class attributes to th and td
2. Tune the appearence of a special table.
   This can still be done by surrounding the table with a span tag
having an id. E.g.
 HTML:
 span id=mySpecialTable wicket:id=tableHere goes the
table/span


 Css:
 #mySpecialTable ... {
 }

Wicket will never be able to serve any of the designers needs out of the
box. If I need a speical DataTable, I can modify the existing one. And
in this case, it would be nice to have a method to override that
controls header generation and not to write a header for my own.

Stefan Lindner


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataTable header manipulation

2006-10-06 Thread Igor Vaynberg
lets see a patch of what you want-IgorOn 10/6/06, Stefan Lindner [EMAIL PROTECTED] wrote:
I think there are two cases:1. Improve the look of all tables generated by DefaultDataTable
 This can be done by adding id and class attributes to th and td2. Tune the appearence of a special table. This can still be done by surrounding the table with a span taghaving an id. 
E.g. HTML: span id=mySpecialTable wicket:id=tableHere goes thetable/span Css: #mySpecialTable ... { }Wicket will never be able to serve any of the designers needs out of the
box. If I need a speical DataTable, I can modify the existing one. Andin this case, it would be nice to have a method to override thatcontrols header generation and not to write a header for my own.Stefan Lindner
-Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cashhttp://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user