cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in table cell editor

Former Member
0 Kudos

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,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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,

Former Member
0 Kudos

Hi ,

Set the value before adding the element.

Try this code.

IParentElement pe = wdContext.nodeParent().createParentElement();
wdContext.nodeParent().addElement(pe);

IChildElement ce = pe.nodeChild().createChildElement();
<b>ce.setA("x");</b>
pe.nodeChild().addElement(ce);

Regards

Bharathwaj

Former Member
0 Kudos

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,

Former Member
0 Kudos

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

Former Member
0 Kudos

Hai Bala,

My main problem is When i select male in one coloumn .

and after i selected another coloumn all coloumns are changed to male.

how can i resolve.

regards,

former_member182372
Active Contributor
0 Kudos

Hi Naga,

Check whethter "Node DEF" is really "Singleton = false".

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

when i tried to bind the data to a table it allows me to checvk ABC only . if i select DEf then ABc is deselected.

How did i bind the data to a table.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hai Bharadwaj I did it using DropdownIndex.

But the problem is when i select in a single row the selected item is changed in all the rows of particular coloumn, i already set child node singleton to false.

Help me soon, its urgent.

regards,

Former Member
0 Kudos

Can you post the whole code you have used ?

Former Member
0 Kudos

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

Former Member
0 Kudos

Hai,

I Used the above code and i bouned P to the table

anb p.c.a to dropdownByIndex

but the data is not coming to the dropdown

Help me ASAp.

regards,

Former Member
0 Kudos

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

Former Member
0 Kudos

Thank You Bala,

I solved the problem.

thank you all of you help me alot.

regards,

naga raju

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Naga Raju,

Please check the explanation in this post.

This thread talks about the similar issue.

Regards,Anilkumar