on 09-06-2006 10:59 AM
Hi,
I am Developing a WebDynPro appln(Java) to create Dynamic UI elements through Coding.
I tried to create a simple Input Field Dynamically.While Running this appln It shows empty UserInterFace
ie I cant see the Input Field ..Im sendin the code for ur reference.
public static void wdDoModifyView(IPrivateDynUIView wdThis, IPrivateDynUIView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if(firstTime) {
//IWDGroup theGroup = (IWDGroup)
//view.getElement("InputGroup");
IWDUIElement uiElement = null;
IWDInputField input = (IWDInputField)view.createElement(IWDInputField.class,"InputField");
input.setValue("xxx");
input.setLength(20);
input.setTooltip("Dynamic Input Field");
input.setVisible(WDVisibility.VISIBLE);
uiElement = input;
// theGroup.addChild(uiElement);
}
//@@end
}
Anything wrong in this Code ?.
I want to Display a Input Field Dynamically.Hw can i get this ? Plz Help me out.
Hi
Try this
if(firstTime) {
IWDTransparentContainer theGroup= (IWDTransparentContainer)view.getElement("RootUIElementContainer");
theGroup.createLayout(com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDMatrixLayout.class);
theGroup.destroyAllChildren();
IWDUIElement uiElement = null;
IWDInputField input = (IWDInputField)view.createElement(IWDInputField.class,"InputField");
input.setValue("xxx");
input.setLength(20);
input.setTooltip("Dynamic Input Field");
input.setVisible(WDVisibility.VISIBLE);
uiElement = input;
theGroup.addChild(uiElement);
}
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did u add this group to the Root UI element Container
IWDTransparentContainer trans=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
trans.addChild( theGroup);
Regards,
Vijayakhanna Raman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For data base value storage use DropDown by index.
For Dictionary Simple type use DropDown by Key.
DropDown by Key:Cteate Attribute and bind it
ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("Attribute name binded to UI");
IModifiableSimpleValueSet val=myType.getSVServices().getModifiableSimpleValueSet();
val.put("Key1","Value");
val.put("Key2","Value");
In Domodify
IWDDropDownByKey di=(IWDDropDownByKey )view.createElement(IWDDropDownByKey .class,"dropindex");
di.bindTexts("Attribute name");
DropDown by index:Bind this by node with Attribute
In init method:
//creating node
IWDNodeInfo n= wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,true,false,true,true,null,null,null);
n.addAttribute("name","ddic:com.sap.String");
//getting child node
IWDNode n1= wdContext.getChildNode("DynamicNode",0);
IWDNodeElement nel=n1.createElement();
String s1=new String("hai");
nel.setAttributeValue("name",s1);
n1.addElement(nel);
IWDNodeElement nel1=n1.createElement();
String s2=new String("bye");
nel1.setAttributeValue("name",s2);
n1.addElement(nel1);
In Domodify
IWDDropDownByIndex di=(IWDDropDownByIndex)view.createElement(IWDDropDownByIndex.class,"dropindex");
di.bindTexts("DynamicNode.name");
Regards,
Vijayakhanna Raman
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.