Hi Daniel,
one example I find:
Code:
package workplace;
import java.io.Serializable;
import org.eclnt.editor.annotations.CCGenClass;
import org.eclnt.jsfserver.elements.impl.FIXGRIDItem;
import org.eclnt.jsfserver.elements.impl.FIXGRIDListBinding;
import org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo;
import org.eclnt.workplace.IWorkpageDispatcher;
import org.eclnt.workplace.WorkpageDispatchedBean;
@CCGenClass (expressionBase="#{d.DemoGridExportHiddenColumns}")
public class DemoGridExportHiddenColumns
extends WorkpageDispatchedBean
implements Serializable
{
public class GridItem extends FIXGRIDItem implements java.io.Serializable
{
protected String m_id;
public String getId() { return m_id; }
public void setId(String value) { m_id = value; }
protected String m_lastName;
public String getLastName() { return m_lastName; }
public void setLastName(String value) { m_lastName = value; }
protected String m_firstName;
public String getFirstName() { return m_firstName; }
public void setFirstName(String value) { m_firstName = value; }
}
public class MyGrid extends FIXGRIDListBinding<GridItem>
{
@Override
public void initialize()
{
super.initialize();
// important: this needs to be done in the initialize() method, not in
// the constructor - the initialize method is called when the grid object
// is connected to its server side component
ColumnInfo ci = m_grid.getColumnInfos().get(0); // the "id-column"
m_grid.getExporter().getAdditionalExportColumnsLeft().add(ci);
}
}
// ------------------------------------------------------------------------
// constructors & initialization
// ------------------------------------------------------------------------
public DemoGridExportHiddenColumns(IWorkpageDispatcher workpageDispatcher)
{
super(workpageDispatcher);
for (int i=0; i<50; i++)
{
GridItem gi = new GridItem();
gi.setId("ID " + i);
gi.setFirstName("FirstName " + i);
gi.setLastName("LastName " + i);
m_grid.getItems().add(gi);
}
}
protected MyGrid m_grid = new MyGrid();
public MyGrid getGrid() { return m_grid; }
}
The column with index 0 normally is hidden in the layout, but is added to the export. So the jsp is:
Code:
<t:fixgrid id="g_6"
bordercolor="#{ccstylevalue.ccLightBorderColor}" borderheight="1"
borderwidth="1"
objectbinding="#{d.DemoGridExportHiddenColumns.grid}"
sbvisibleamount="10" width="100%">
<t:gridcol id="g_7" rendered="false" text="Id" width="100">
<t:field id="g_8" text=".{id}" width="100" />
</t:gridcol>
<t:gridcol id="g_9" text="First Name" width="50%">
<t:field id="g_10" text=".{firstName}" width="100" />
</t:gridcol>
<t:gridcol id="g_11" text="Last Name" width="50%">
<t:field id="g_12" text=".{lastName}" width="100" />
</t:gridcol>
</t:fixgrid>
Regards, Björnn