on 03-03-2006 9:50 AM
Hai,
I inserted as a dropdownkey in table, Parent node ABc is bind to table , the child node DEf bind to coloumn dropdownbyindex. i set child node singleton as false, but its giving null pointer exception.
IXXXView.IABCNode iu=wdContext.nodeABC();
IXXXView.IDEFElement c=iu.nodeDEF().createDEFElement();
How to Solve this.
Hope Anil and Piyush will help me they already know about this problem.
regards,
A non-singleton child node exists inside a node element of its parent node. So you first must create a node element in the parent node.
Like this:
IParentElement pe = wdContext.nodeParent().createParentElement();
wdContext.nodeParent().addElement(pe);
IChildElement ce = pe.nodeChild().createChildElement();
pe.nodeChild().addElement(ce);
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Armin,I solved it, Thanks for your help.
But another problem is rising i.e.
I created a table and insert a coloumn in table created a cell editor dropdownindex. i bind the node child to the table .
and wrote the code as you said.
IParentElement pe = wdContext.nodeParent().createParentElement();
wdContext.nodeParent().addElement(pe);
ArrayList a=new ArrayList();
IChildElement ce = pe.nodeChild().createChildElement();
pe.nodeChild().addElement(ce);
ce.setA("x");
a.add(ce);
wdContext.nodeChild().bind(a);
But iam not getting this x into the dropdown
Please help me.
regards,
Hai Bharadwaj,
happy to see you again, I think I am in wrong with creating table cell editor.
i will say my requirement please help me to do:
in the table the first coloumn is number, second one is name, third one is sex ,this coloumn contains two standard Strings male and female, the can select from dropdown index.
what i did is I created context node parent ABC
in that attributes name , age and another node DEF having attribute S.
I created a table and bind the node ABC(its not allow me to check DEF node).
i deleted table cell editor of column sex and created new editor dropdownindex. and binded texts is node DEF
DEF is set to singleton false.
Give me the suggetion.
regrds,
Hello,
<i> third one is sex ,this coloumn contains two standard Strings male and female, the user can select </i>
Since you say that the values are standard you may use dropDownByKey instead of dropDownByIndex.
Use this context structure:
Context
|_Node ABC
|_Number (Value Attribute, Integer)
|_Name (Value Attribute, String)
|_Node DEF (Value Node, Singleton = false, 1:1)
|_Sex (Value Attribute, ddic)
where ddic is a simpletype defined in your dictionary with values Male and Female.
Map the Node ABC to your table (Table Data Source).Map the Attribute Sex to the dropDownByKey.
Write suitable code for filling the table.
Bala
Hi,
Considering your scenario.. where u want to use the drop down to select MALE or Female..
The simplest way to do would b to..
Go to Dictionaries -> Local Dictionary -> Simple Type - > Create a new simple type.
In Enumeration..
Give the key value pairs as Male- Male and Female-Female.
Create a value attribute inside the node ABC . Lets call is ddattr.
Convert the type of this attribute as the simple type.This can be done by selecting Dictionary simple type and selecting te appropriate simple type you have created.
Now bind this attribute of the node ABC .. to dropdwnbyKey.
This will give u the desired result
Hai Bharadwaj,
P--(parent node)
C--(child node)set to singleton=false. |
a(attribute of type string)
ArrayList a=new ArrayList();
ArrayList b=new ArrayList();
for(int i=0;i<5;i++){
IPrivateAuthUploadApplicationView.IPElement parent=wdContext.nodeP().createPElement();
wdContext.nodeP().addElement(parent);
for(int j=0;j<5;j++){
IPrivateAuthUploadApplicationView.ICElement child=parent.nodeC().createCElement();
child.setA("hai"+j);
b.add(child);
}
parent.nodeC().bind(b);
a.add(parent);
}
wdContext.nodeP().bind(a);
Help me ASAP
Hello Naga,
Modify your code like this.
for(int i=0; i<5; i++)
{
IPrivateAuthUploadApplicationView.IPElement
parent = wdContext.nodeP().createPElement();
wdContext.nodeP().addElement(parent);
for(int j=0; j<5; j++)
{
IPrivateAuthUploadApplicationView.ICElement
child = parent.nodeC().createCElement();
child.setA("hai"+j);
parent.nodeC().addElement(child);
}
}
Bala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.