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

step of dynamic programming of UI element.

hi everyone,

can u tell me the full step of dynamic programming of any Ui element from first step to last step.what should write in wdmodify() and wddoinit()?i have that sdn pdf file but i want without creating that java file?

plz tell me.its urgent.

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 Apr 14, 2008 at 05:58 AM

    Here is the step to create a table:-

    String currentTable = "<node from where the data is to fetch>"

    String field = "<Attribute names othe node currentTable >"

    IWDTable table = null;

    IWDUIElementContainer root;

    IWDTransparentContainer transCon;

    root = (IWDUIElementContainer) view.getRootElement();

    root.createLayout(IWDMatrixLayout.class);

    IWDMatrixHeadData rootData = (IWDMatrixHeadData)root.createLayoutData(IWDMatrixHeadData.class);

    rootData.setHAlign(WDCellHAlign.CENTER);

    rootData.setVAlign(WDCellVAlign.MIDDLE);

    //Create a transparent contenair in the root element statically

    transCon = (IWDTransparentContainer) view.getElement("TransparentContainer1");

    table = (IWDTable)view.createElement(IWDTable.class, null);

    //Create the table Here

    IWDTableColumn column = (IWDTableColumn)view.createElement(IWDTableColumn.class, null);

    IWDCaption caption =(IWDCaption)view.createElement(IWDCaption.class, null);

    caption.setText(headerText);

    column.setHeader(caption);

    editor = (IWDTextView)view.createElement(IWDTextView.class, null);

    editor.bindText(currentTable + "."+fieldName.trim());

    column.setHAlign(WDTableColumnHAlign.CENTER);

    column.setTableCellEditor(editor);

    table.addColumn(column);

    table.setReadOnly(true);

    table.setSelectionMode(WDTableSelectionMode.NONE);

    //Add teh table to the container

    transCon.addChild(table);

    It will work perfectly

    Regards

    -Sandip

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 14, 2008 at 05:51 AM

    Hi Abhilasha,

    Check this following link for sample source code dynamic UI element application.

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/business_packages/a1-8-4/17tutwd_dynamic.zip

    create-dynamic-table

    Regards, Suresh KB

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 14, 2008 at 05:55 AM

    Hi,

    Here the sample coding for dynamic creation which u need to write in doModify(),

    IWDTransparentContainer rootElement = (IWDTransparentContainer)view.getRootElement();

    IWDNodeInfo tabNode=wdContext.getNodeInfo().addChild("Tab_Node",null,true,true,true,false,true,false,null,null,null);

    IWDAttributeInfo tabAttrib_Name=tabNode.addAttribute("Name","ddic:com.sap.dictionary.string");

    IWDAttributeInfo tabAttrib_Add=tabNode.addAttribute("Address","ddic:com.sap.dictionary.string");

    IWDTable tab=(IWDTable)view.createElement(IWDTable.class,"Dyntable");

    IWDAttributeInfo attrib1=tabNode.getAttribute("Name");

    IWDAttributeInfo attrib2=tabNode.getAttribute("Address");

    tab.bindDataSource(tabNode);

    tab.setCompatibilityMode(WDTableCompatibilityMode.AUTO);

    tab.setDesign(WDTableDesign.ALTERNATING);

    IWDTableColumn tabColumn1=(IWDTableColumn)view.createElement(IWDTableColumn.class,"NameCol");

    IWDTableColumn tabColumn2=(IWDTableColumn)view.createElement(IWDTableColumn.class,"AddressCol");

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

    nameCap.setText("Name");

    tabColumn1.setHeader((IWDCaption)nameCap);

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

    addCap.setText("Address");

    tabColumn2.setHeader((IWDCaption)addCap);

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

    nameText.bindValue(attrib1);

    tabColumn1.setTableCellEditor((IWDTableCellEditor)nameText);

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

    addText.bindValue(attrib2);

    tabColumn2.setTableCellEditor((IWDTableCellEditor)addText);

    tab.addColumn(tabColumn1);

    tab.addColumn(tabColumn2);

    tab.createLayoutData(IWDRowHeadData.class);

    tab.setWidth("300");

    IWDNode dynTabNode=(IWDNode)wdContext.getChildNode("Tab_Node",0);

    for(int i=0; i<5;i++)

    {

    IWDNodeElement dynTabElem=(IWDNodeElement)dynTabNode.createElement();

    dynTabElem.setAttributeValue("Name","Karthik");

    dynTabElem.setAttributeValue("Address","Chennai");

    dynTabNode.addElement(dynTabElem);

    }

    rootElement.addChild(tab);

    // you should create one action for the table lead selection

    IWDAction tabact=(IWDAction)wdThis.wdGet<Actionname>();

    tab.setOnLeadSelect(tabact);

    Hop it helps,

    GS

    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.