Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.3
Description
When you create a TreeTable with only one column in the middle (Alignment.MIDDLE), the column is not display in the browser.
When you look at the HTML code, the width is set to 00%:
...
<div class="a_">
<span class="b_" style="width:00%">
<span class="c_">...
</span>
</div>
...
The error comes from the MiddleColumnsView class where the number is formatted :
/**
- @see org.apache.wicket.MarkupContainer#onRender()
*/
@Override
protected void onRender()
{
Response response = RequestCycle.get().getResponse();
double widths[] = computeColumnWidths();
NumberFormat nf = NumberFormat.getNumberInstance(Locale.ENGLISH);
nf.setMaximumFractionDigits(0);
nf.setMaximumIntegerDigits(2); // <--------- Should be nf.setMaximumIntegerDigits(3); to handle value > 99
for (int i = 0; i < columns.size(); ++i)
{
Component component = components.get;
IRenderable renderable = renderables.get;
IColumn column = columns.get;
// write the wrapping column markup
response.write("<span class=\"b_\" style=\"width:" + nf.format(widths[i]) + "%\">");
To reproduce you can use the TreeTablePage class from wicket example and keep only one "middle" column :
...
IColumn columns[] = new IColumn[]
;
...