You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jan Kriesten (JIRA)" <ji...@apache.org> on 2007/10/13 13:58:50 UTC

[jira] Created: (WICKET-1069) RFE: DataTable && colgroup

RFE: DataTable && colgroup
--------------------------

                 Key: WICKET-1069
                 URL: https://issues.apache.org/jira/browse/WICKET-1069
             Project: Wicket
          Issue Type: Improvement
          Components: wicket-extensions
         Environment: any
            Reporter: Jan Kriesten



Hi!

I want to suggest an enhancement for the DataTable extension.

Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:

- You have to extend the IStyledColumn to return the proper CSS class.
- You have to add a bunch of CSS classes to get the proper styles.
- You have redundancy in HTML output - which isn't necessary.

This is actually what <colgroup><col></colgroup> is meant to solve.

My suggestion:

Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.

A quick implementation would be this:

---[ColGroup.java]--
import java.util.List;

import org.apache.wicket.behavior.IBehavior;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.repeater.RepeatingView;

public class ColGroup
    extends AbstractToolbar
{
  private static final long serialVersionUID = 1L;

  private int numCols;
  private Col[] cols;

  public ColGroup( DataTable datatable, int numCols )
  {
    super( datatable );
    this.numCols = numCols;
  }

  public void onBeforeRender()
  {
    if( !hasBeenRendered() )
    {
      WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
      for( IBehavior b : (List<IBehavior>) getBehaviors() )
        colgroup.add( b );
      setRenderBodyOnly( true );
      removeAll();
      add( colgroup );

      RepeatingView colgroupCols = new RepeatingView( "elements" );
      colgroup.add( colgroupCols );

      for( Col column : getCols() )
      {
        WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
        colgroupCols.add( item );
        item.add( column );
      }

    }
    super.onBeforeRender();
  }

  public final Col[] getCols( )
  {
    if( cols == null )
    {
      cols = new Col[numCols];
      for( int i = 0; i < numCols; i++ )
        cols[i] = new Col();
    }
    return(cols);
  }

  public final class Col
      extends WebMarkupContainer
  {
    private static final long serialVersionUID = 1L;

    private Col()
    {
      super( "col" );
    }
  }

}
---[/ColGroup.java]--

---[ColGroup.html]--
  <wicket:panel>
    <colgroup wicket:id="colgroup">
      <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
    </colgroup>
  </wicket:panel>
---[/ColGroup.html]--


Usage:

ColGroup colgroup = new ColGroup( datatable, 4 );
colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
Col[] cols = colgroup.getCols();
cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
datatable.addColGroup( colgroup );


Any thoughts?

Regards, --- Jan.




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matej Knopp updated WICKET-1069:
--------------------------------

    Fix Version/s:     (was: 1.3.0-beta5)
                   1.4.0-alpha

Postponing as this should not delay the 1.3 release

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>             Fix For: 1.4.0-alpha
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1069:
-------------------------------------

    Assignee: Matej Knopp

matej, you said we might want to put this in? even though it doesnt always work in mozilla browsers as pointed out on the list?

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Thomerson updated WICKET-1069:
-------------------------------------

    Fix Version/s:     (was: 1.5-M3)
                   1.5-M4

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.5-M4
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matej Knopp updated WICKET-1069:
--------------------------------

    Priority: Minor  (was: Major)

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.4-M1
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-1069:
----------------------------------

    Fix Version/s: 1.5-M3
                       (was: 1.5-M2)

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.5-M3
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Bille Jensen updated WICKET-1069:
---------------------------------------

    Fix Version/s:     (was: 1.4-M2)
                   1.4-M3

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.4-M3
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-1069:
----------------------------------

    Fix Version/s:     (was: 1.4-M4)
                   1.5-M1

move new features to 1.5

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.5-M1
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-1069:
----------------------------------

    Fix Version/s: 1.5-M2
                       (was: 1.5-M1)

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.5-M2
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Bille Jensen updated WICKET-1069:
---------------------------------------

    Fix Version/s:     (was: 1.4-M1)
                   1.4-M2

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.4-M2
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1069) RFE: DataTable && colgroup

Posted by "Martijn Dashorst (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martijn Dashorst updated WICKET-1069:
-------------------------------------

    Fix Version/s:     (was: 1.4-M3)
                   1.4-M4

Moved to next milestone release.

> RFE: DataTable && colgroup
> --------------------------
>
>                 Key: WICKET-1069
>                 URL: https://issues.apache.org/jira/browse/WICKET-1069
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.4-M4
>
>
> Hi!
> I want to suggest an enhancement for the DataTable extension.
> Right now it's only possible to style columns (width, alignment, color etc.) via stylesheets. This has some not so nice implications IMHO:
> - You have to extend the IStyledColumn to return the proper CSS class.
> - You have to add a bunch of CSS classes to get the proper styles.
> - You have redundancy in HTML output - which isn't necessary.
> This is actually what <colgroup><col></colgroup> is meant to solve.
> My suggestion:
> Adding a 'addColGroup( ColGroup cg )'-feature, which actually lets you add x ColGroups with n Cols on which you can use AttributeModifiers to have your styles/classes/width-Attributes added.
> A quick implementation would be this:
> ---[ColGroup.java]--
> import java.util.List;
> import org.apache.wicket.behavior.IBehavior;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractToolbar;
> import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.repeater.RepeatingView;
> public class ColGroup
>     extends AbstractToolbar
> {
>   private static final long serialVersionUID = 1L;
>   private int numCols;
>   private Col[] cols;
>   public ColGroup( DataTable datatable, int numCols )
>   {
>     super( datatable );
>     this.numCols = numCols;
>   }
>   public void onBeforeRender()
>   {
>     if( !hasBeenRendered() )
>     {
>       WebMarkupContainer colgroup = new WebMarkupContainer( "colgroup" );
>       for( IBehavior b : (List<IBehavior>) getBehaviors() )
>         colgroup.add( b );
>       setRenderBodyOnly( true );
>       removeAll();
>       add( colgroup );
>       RepeatingView colgroupCols = new RepeatingView( "elements" );
>       colgroup.add( colgroupCols );
>       for( Col column : getCols() )
>       {
>         WebMarkupContainer item = new WebMarkupContainer( colgroupCols.newChildId() );
>         colgroupCols.add( item );
>         item.add( column );
>       }
>     }
>     super.onBeforeRender();
>   }
>   public final Col[] getCols( )
>   {
>     if( cols == null )
>     {
>       cols = new Col[numCols];
>       for( int i = 0; i < numCols; i++ )
>         cols[i] = new Col();
>     }
>     return(cols);
>   }
>   public final class Col
>       extends WebMarkupContainer
>   {
>     private static final long serialVersionUID = 1L;
>     private Col()
>     {
>       super( "col" );
>     }
>   }
> }
> ---[/ColGroup.java]--
> ---[ColGroup.html]--
>   <wicket:panel>
>     <colgroup wicket:id="colgroup">
>       <wicket:container wicket:id="elements"><col wicket:id="col"/></wicket:container>
>     </colgroup>
>   </wicket:panel>
> ---[/ColGroup.html]--
> Usage:
> ColGroup colgroup = new ColGroup( datatable, 4 );
> colgroup.add( new SimpleAttributeModifier( "style", "border: solid 1px green;" ) );
> Col[] cols = colgroup.getCols();
> cols[0].add( new SimpleAttributeModifier( "width", "10%" ) );
> cols[1].add( new SimpleAttributeModifier( "width", "35%" ) );
> cols[2].add( new SimpleAttributeModifier( "width", "45%" ) );
> cols[3].add( new SimpleAttributeModifier( "width", "10%" ) );
> datatable.addColGroup( colgroup );
> Any thoughts?
> Regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.