Skip to Content
avatar image
Former Member

inserting rows at runtime

Hello Community,

is it possible to create a Table at design time, determine its columns and insert rows at run time like inserting nodes to the TreeView at run time?

Is it possible to do this in wdDoInit(..), how do i get the handle to the table then?

Regards and thank's a lot for answers.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 10, 2004 at 03:08 PM

    Hi Robert,

    yes, this is possible. Create an empty table (no columns) at design time and do the Columns creation including Column-headers and Columns-editors at runtime.

    Dynamic view changes can only be done in the wdDoModifyView() method of the view controller, you can get a reference to the table by:

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

    The location for the creation of the context node you'll use for table's dataSource and columns' editors value binding is not limited. You can do this in wdDoInit() or in wdDoModifyView(), whatever you like most.

    If you need more help doing this, please return.

    Hope that helps.

    Best regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 10, 2004 at 04:01 PM

    What do you exactly want to do? At design time, you can create the table structure, i.e. adding table columns and setting editors/renderers and binding their properties to context items.

    The rows can only be provided at runtime. They are automatically created from the context node elements in the table's data source.

    The data source is the view context node, to which the table's property "dataSource" is bound.

    You can also create the table and its structure completely at runtime. As Stephan correctly notes, the UI element instances can only be accessed in the static wdDoModifyView() method of the view controller class.

    Context manipulations should be done in event handler methods or in the wdDoInit() method of the controller.

    Armin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      As I said, the rows are created automatically from the node elements. To add a row, you simply add a node element (in an event handler method for example). You do not need to have a reference to the table to do this.

      Armin