on 06-26-2008 5:58 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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...
Rows in the table are created from elements in the context node. You have defined the cardinality of the context node as 1:n, this will give you one element automatically. To get more elements (rows) you have to create and add elements to the node using code like
I<YourNode>Element e = wdContext.node<YourNode>.createAndAdd<YourNode>Element();
e.setXYZ(value);
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roshan,
Change the properties like this and try:
cardinality : 0..n
collectionType : list
selection 0..n
singleton true
typedAccessRequired true.
Your problem is to add the elements to this node, I guess you are taking input from the table UI element. Then you must create elements to this node.
IPrivate<viewname>.I<nodename>node node = wdContext.node<nodename>();
for(int i=0; *i<10* ; i++)
{
IPrivate<viewname>.I<nodename>Element ele = node.create<nodename>Element();
//If you want you can set you attributes here
node.addElement(ele);
}
10 elements are created.
You can create & add elements like this.
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try with changing the cardinality.
if you put the code you are using, it will be helpful to findout
regards,
Pradeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pradeep,
I did change the cardinality but that hasnt worked.I havent coded anything as of now, all changes in the setting are being made in the SAP netweaver development studio.The coding part i would look into later, where i need to put in my business logic.I am doing a POC on Web Dynpro bacis features, without considering the ABAP part.
Thanks for the reply mate
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.