You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org> on 2011/11/24 17:11:41 UTC

[jira] [Resolved] (WICKET-4226) TreeColumn not displayed when there is only one "Alignment.MIDDLE" column

     [ https://issues.apache.org/jira/browse/WICKET-4226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4226.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0
                   1.5.4
         Assignee: Martin Grigorov
    
> TreeColumn not displayed when there is only one "Alignment.MIDDLE" column
> -------------------------------------------------------------------------
>
>                 Key: WICKET-4226
>                 URL: https://issues.apache.org/jira/browse/WICKET-4226
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.5.3
>            Reporter: Gabriel LANDON
>            Assignee: Martin Grigorov
>              Labels: column, treetable
>             Fix For: 1.5.4, 6.0.0
>
>         Attachments: MiddleColumnsView.patch
>
>
> 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(i);
> 			IRenderable renderable = renderables.get(i);
> 			IColumn column = columns.get(i);
> 			// 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[] {
> 				new PropertyTreeColumn<String>(new ColumnLocation(Alignment.MIDDLE, 8,
> 					Unit.PROPORTIONAL), "Tree Column (middle)", "userObject.property1"),
> 				new PropertyRenderableColumn<String>(
> 					new ColumnLocation(Alignment.RIGHT, 8, Unit.EM), "R1", "userObject.property6"), };
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira