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

How to add data in table dynamically?

Hi,

I created Tabstrip and table for first tab dynamically. I want to display this table data for second tab dynamically.

1) How to enter data data in the table.

2) How to add view to the tab.

3) Whenever i click the checkboxes in table , corresponding tab will be visible in view. How it is?

  • These all are dynamically only.

Plz help me, it's very urgent.

Thanks

KSR

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 27, 2007 at 12:36 PM

    Hi,

    1) How to enter data data in the table.

    Create an element of the node bound to the table or to make it editable initially set the* cardinality of the node bound to 1..n*

    2) How to add view to the tab.

    You can use viewcontainer UI element to add views to a tab. Place this control in the tab and from window embed the view want.

    3) Whenever i click the checkboxes in table , corresponding tab will be visible in view. How it is?

    Create a context attribute and bind this to the selectedTab property of the tab and set the ID of the tab to be selected.

    Regards

    Ayyapparaj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 27, 2007 at 12:21 PM

    Hi KSR,

    Dont add view to the tab. Create one View in that create tabstrip UI element add your specific table to the corresponding tabstrip content area. so that you easily toggle between the tab using action button.

    Code snippet for changing tab view:

    wdContext.currentContextElement().setSelectedTab("Tab1");

    Dynamic table creation code snippet you can find here(SDN).

    Let me know if you need more details.

    Regards, Suresh KB

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi KSR,

      As per your requirements I can see you want to show data dynamically between two tabs according to checkbox action. In this case I would suggest you to create tabstrib using UI element under the content area you create required UI elements rather than adding(embeding) view to the tabstrip.

      Dynamic table sample code: [Here|create-dynamic-table;

      Regards, Suresh KB

  • Posted on Dec 28, 2007 at 04:40 AM

    Hi,

    In following manner you can create a dynamic node and bind to a dynamically created table

    (1)You can create a Node dynamically for Table (data source binding)

    IWDNodeInfo tableNodeInfo = wdContext.getNodeInfo().addChild("TABLE_ID", null,true, CMICardinality.MANY,CMICardinality.MANY, true, null);

    (2) In Next Step add the attributes in following manner.

    IWDAttributInfo attr=tableNodeInfo.addAttribute("att1","com.sap.dictionary.string");

    (a)In wdDoModify method create your table dynamically

    IWDTable table=(IWDTable)view.createElement(IWDTable.class,"DetailTable");

    Binding table with the data source

    table.bindDataSource(tableNodeInfo.getName());

    (b)Creating Column and cellEditor

    IWDTableColumn tableColumn =(IWDTableColumn)view.createElement(IWDTableColumn.class,"tableColumn");

    IWDCaption tableHeaderCaption = (IWDCaption)view.createElement(IWDCaption.class,"tableHeaderCaption");

    IWDInputField tableCellInputField= (IWDInputField) view.createElement(IWDInputField.class,"tableCellInputField");

    (c)binding inputfield value

    tableCellInputField.bindValue(tableNodeInfo.getName()"."attr.getName());

    REgards,

    Praveen

    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.