on 04-14-2008 6:42 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhilasha,
Check this following link for sample source code dynamic UI element application.
Regards, Suresh KB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
26 | |
10 | |
10 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.