on 07-13-2006 8:21 AM
Hi,
I want to make UIElement dynamically in Group.
But,It is in the code below ..the error...
Could anyone teach?
================================================
sample
public static void wdDoModifyView(......)
if(firstTime){
IWDGroup rootElement = (IWDGroup)view.getRootElement();
rootElement.createLayout(IWDMatrixHeadData.class);
IWDNodeInfo soNodeinfo = wdContext.getNodeInfo();
for(int i = 0 ;i<3;i++){
Iterator iter = soNodeinfo.iterateAttributes();
IWDAttributeInfo soAttrInfo = (IWDAttributeInfo)iter.next();
IWDLabel label = (IWDLabel)view.createElement(IWDLabel.class,soAttrInfo.getName() + "Label" + i);
label.setText("test");
label.setDesign(WDLabelDesign.STANDARD);
label.createLayoutData(IWDMatrixHeadData.class);
rootElement.addChild(label);
IWDInputField input = (IWDInputField)view.createElement(IWDInputField.class,soAttrInfo.getName() + "sample" + i);
input.createLayoutData(IWDMatrixData.class);
input.bindValue("test1");
rootElement.addChild(input);
}
========================================================
Regards,
BESS,
First of all, you are adding controls to wrong parent.
Instead of
IWDGroup rootElement = (IWDGroup)view.getRootElement();
use
IWDGroup rootElement = (IWDGroup)view.getElement("place-here-id-of-group");
Next, your code for iterating attributes has errors as well.
instead
for(int i = 0 ;i<3;i++){
Iterator iter = soNodeinfo.iterateAttributes();
IWDAttributeInfo soAttrInfo = (IWDAttributeInfo)iter.next();
...
}
use
for(final Iterator iter = soNodeinfo.iterateAttributes(); iter.hasNext(); ) {
IWDAttributeInfo soAttrInfo = (IWDAttributeInfo)iter.next();
...
}
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,VS
Thank you for teaching.
There is another one question.
I want to make UIElement(Group) dynamically.
I want you to teach the code dynamically made
UIElement(Group)
because it should already set Group to Layout.
====================================================
IWDGroup rootElement = (IWDGroup)view.getElement("Group1");
====================================================
Regards,
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.