cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to add a record into Table created in Web Dynpro java application

Former Member
0 Kudos

Dear All,

While creating a table, I have selected a context node and its attributes to be bound to this table.The properties of this context node are mentioned below

cardinality : 1..n

collectionType : list

selection 1..n

singleton false

typedAccessRequired true.

But in the Table created I not able to add/edit more than 1 row.

Would really appreciate if some 1 would help me out here

Edited by: Roshan N on Jun 26, 2008 6:58 AM

View Entire Topic
nikhil_bose
Active Contributor
0 Kudos

why do you keeping singleton to false? set it to default value true

Singleton:

property determines the parent-child relation.

if true: for each parent element, there is one child (i.e. 1 - 1)

if false: irrespective of parent, there is only one child ( Many to one).

nikhil

Edited by: Nikhil ßos on Jun 26, 2008 11:00 AM

Former Member
0 Kudos

Nikhil,

In my case i need the parent child relationship to be 1-many.How should I go about doing that?

nikhil_bose
Active Contributor
0 Kudos

make singleton to true. it will work

Actually there is a correction in my previous post.

if singleton is true it is 1 - Many.

nikhil

Edited by: Nikhil ßos on Jun 26, 2008 4:43 PM

Former Member
0 Kudos

Nikhil,

that hasnt worked.Do I have to change any table properties

which are currently set as below

compatibilityMode auto

dataSource Task

design standard

enabled true

firstVisibleRow 0

firstVisibleScrollableCol

fixedTableLayout false

footerVisible true

gridMode both

readOnly false

rowSelectable true

scrollableColCount -1

selectedPopin

selectionChangeBehaviour auto

selectionMode auto

visible visible

visibleRowCount 10

regards,

Roshan

nikhil_bose
Active Contributor
0 Kudos

There is no manual settings needed. Its quite straight-forward.

1) create a node TableNode. don't change default values

2) add attribute Name of type string.

1)place a table UI element in the view

2) bind data source property

3) create a table column and table cell editor as textview

4) bind value to TableNode-Name

now, we will populate some values.

in the wdDoInit() place the code


IPrivate<YourCompName>View.ITableNodeElement   element;
String values[]={"One","Two","Three","Four"};
for( int i = 0; i<values.length; i++) {
  element = wdContext.createTableNodeElement();
  element.setName(values<i>);
  wdContext.nodeTableNode().addElement(element);
}

nikhil

Former Member
0 Kudos

hi try this code.cardinality 0.n

IPrivateFormView.ITableElement ele=wdContext.createTableElement();

ele.setId(wdContext.currentContextElement().get<valueattr>());

ele.setName(wdContext.currentContextElement().get<valattr());

ele.setSalary(wdContext.currentContextElement().getvalattr());

int size = wdContext.nodeTable().size();

for(int i=0;i<size;i++)

{

if(wdContext.currentContextElement().getId()==wdContext.nodeTable().getTableElementAt(i).getId())

{

wdComponentAPI.getMessageManager().reportWarning("record already inserted");

return;

}

}

wdContext.nodeTable().addElement(ele);

wdComponentAPI.getMessageManager().reportSuccess("record suceefully installed");

Thanks if helpful give me points

No new information but asking for points...