Version 8.3.4
 —  Layout Elements  —

COLINFOS Control - Show and Hide Single Columns

COLINFOS is a container control that allows to dynamically show and hide single columns in a ROWTABLEAREA2 control. The COLINFOS container can only contain COLINFO controls. Each COLINFO control is responsible for one column.

Notes:

  1. This feature can only be used with Internet Explorer. It cannot be used with Mozilla Firefox or Netscape since these browsers do not support the COLGROUP and COL elements as defined with the HTML 4.01 specification.
  2. The COLINFOS control is deprecated. It is recommended that you use the visibleprop property of the GRIDCOLHEADER control instead.

The following topics are covered below:


Example

The table in this example has three columns: the first column contains a SELECTOR control for the numbers, the second column contains a FIELD control for the first names, and the third column contains a FIELD control for the last names.

The second column (first name) can be visible.

Colinfos

You can also hide the second column (first name).

Colinfos

The XML layout definition is:

<pagebody>
  <rowarea name="ROWTABAREA2 with colinfos">
  <rowtablearea2 griddataprop="lines" rowcount="5">
    <colinfos>
    <colinfo></colinfo>
    <colinfo visibleprop="col2"></colinfo>
    </colinfos>
    <tr>
    <gridcolheader name=" " width="30">
    </gridcolheader>
    <gridcolheader name="First Name" width="120">
    </gridcolheader>
    <gridcolheader name="Last Name" width="120">
    </gridcolheader>
    </tr>
    <repeat>
    <str valueprop="selected">
      <selector valueprop="selected" width="30" singleselect="true">
      </selector>
      <field valueprop="fname" width="120" displayonly="true"
         noborder="true">
      </field>
      <field valueprop="lname" width="120" displayonly="true"
         noborder="true">
      </field>
    </str>
    </repeat>
  </rowtablearea2>
  </rowarea>
</pagebody>

A COLINFO control is required for each column that is to be shown/hidden dynamically. The responsibility for the columns goes from left to right. Thus, the first COLINFO control applies to the first column, the second COLINFO control applies to the second column, and so on.

In the above example, two COLINFO controls are used even though only the second column is to be shown/hidden. The first COLINFO control is required since the columns are calculated from left to right. Since the first COLINFO control does not have a visibleprop property, this column is always visible.

If you would omit the first COLINFO control, the visibleprop property of the remaining COLINFO control would be applied to the first column containing the numbers (and not to the second column containing the first name).

A third COLINFO control is not required in this example, since you do not want to show/hide the third column containing the last name.

The Java code of the adapter is:

public class colinfosAdapter
extends Adapter
{
  // property >col2<
  boolean m_col2 = true;
  public boolean getCol2() { return m_col2; }
  public void setCol2(boolean value) { m_col2 = value; }

  // class >LinesItem<
  public class LinesItem
  {
    // property >fname<
    String m_fname;
    public String getFname() { return m_fname; }
    public void setFname(String value) { m_fname = value; }

    // property >lname<
    String m_lname;
    public String getLname() { return m_lname; }
    public void setLname(String value) { m_lname = value; }

    // property >selected<
    boolean m_selected;
    public boolean getSelected() { return m_selected; }
    public void setSelected(boolean value) { m_selected = value; }
  }

  // property >lines<
  GRIDCollection m_lines = new GRIDCollection();
  public GRIDCollection getLines() { return m_lines; }

  /** initialisation - called when creating this instance*/
  public void init()
  {
    // generate some content for the displayed lines ...
    LinesItem item;
    for (int i = 0; i < 5; i++)
    {
      item = new LinesItem();
      item.m_fname = "First Name " +i;
      item.m_lname = "Last Name "+i;
      m_lines.add(item);
    }
  }

  public void onSwitch()
  {
  // switch visibility of the second column
    m_col2 = !m_col2;
  }
}

Top of page

COLINFOS Properties

Basic
comment

Comment without any effect on rendering and behaviour. The comment is shown in the layout editor's tree view.

Optional  

Top of page

COLINFO Properties

Basic
visibleprop

Name of property that tells if the corresponding column that is associated with the colinfo-control is displayed or not. Property must be of type "boolean".

Optional  
comment

Comment without any effect on rendering and behaviour. The comment is shown in the layout editor's tree view.

Optional  

Top of page