Skip to Content
author's profile photo Former Member
Former Member

Changing table layout at runtime

I've created a table at design time which is mapped to a model. Later at runtime I want to dynamically add different columns from this model to the table and bind them.

The object IWBTable offers several methods to manipulate the table layout including binding columns to models. But at runtime I can't manage to get access to the runtime table instance. Is it possible to get access to that object at all? If not how can I manipulate the table layout at runtime without manipulating the model?

Best regards,

Christian

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Apr 01, 2004 at 03:47 PM

    Christian,

    the only method where you can access view elements is the static method wdDoModifyView() in the view controller class. (Please read also the JavaDoc comment of this method).

    In that method, you may access and create view elements.

    Example: How to create a new table column with ID "myColumn" that uses an InputField as its cell editor, and adding the column to an existing table with ID "myTable":

    IWDTable table = (IWDTable) view.getElement("myTable");

    IWDTableColumn column = (IWDTableColumn) view.createElement(IWDTableColumn.class, "myColumn");

    IWDInputField editor = (IWDInputField) view.createElement(IWDInputField.class, null /* ID not needed */);

    editor.bindValue("someTableDataAttributePath");

    column.setTableCellEditor(editor);

    table.addColumn(column);

    Hope this helps!

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.