on 03-25-2008 5:29 PM
I want to create a table with 10 colums. The colums should be empty so the user can input some values.
ArrayList emptyTable = new ArrayList();
for (int i = 0; i < 10; i++) {
// Create empty Entries
elem = wdContext.nodeXXX().createXXXElement();
elem.setFirstName("");
wdContext.nodeXXX().addElemen(elem);
}
Does someone know a better way?
Hi,
Code what you have posted is for creating elements for a node.
Is this your requirement?
You can change the above code to as follows
for (int i = 0; i < 10; i++) {
// Create empty Entries
elem = wdContext.nodeXXX().createXXXElement();
wdContext.nodeXXX().addElemen(elem);
}
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At first: I mean rows
The code works fine. The problem is that when the user click from one row to next row its during 2 - 3 seconds before the user can input some values...
It s look like a server roundtrip...
Is it possible that the user can click into the next row without waiting before he can insert same values?
Any performance suggestions?
Hi,
table property compatibilityMode
Regards
Ayyapparaj
Hi,
In View Insert a Table and create a Node Element and the Corresponding Attributes according to the number of column.
and bind the data Source Property of the Table with the NodeElement and Insert Columns , headeramd table cell editor like Text View or Input Field or anything.
Bind the Property of the table Cell Editor with the Node Attributes .
Finally in the DoInit Method set the values entered by the user with the Node Attributes .
INodeElement nodeElement = wdContext.CreateNodeElement();
nodeElement.setAttribute();
and finally add the elemnt .
wdContext.nodeNodeElement.addElement(nodeElement);
if you are sure that user is going to enter all the 10 columns(In all the visible rows) use for loop .else use if condition within the for loop , if the user enter only 2 rows
if( wdContext.currentNodeElement.getAttribute!= null )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
u can do like below.
1)create a table
2)Create a Valuenode Emp
3)Under EMP node create two attributes empno,ename.
4)Then u can attch the datasource property to the Emp node.
5)Then u can fill the columns manually like below
IPrivateview1.IEmpNode node1=wdContext.nodeEmp();
IPrivateView1.IEmpElement ele;
ele=node1.createEmpElement();
ele.setEmpno("1");
ele.setEname("Ram");
node1.addElement(ele);
ele=node1.createEmpElement();
ele.setEmpno("2");
ele.setEname("Raj");
node1.addElement(ele);
Note:In the above View1 is the view name
Regards
Hazrath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi SAP User,
I don;t know why you are following this way.
You can directly use the table UI element in to view and add a column with ColumnCellEditor. There is one more option on number of columns that you can set according to your requirement.
No need of any code and get the values directly from context elements that you bind to the UI Element.
Hope this may solve your Qust.
Regards
- Vinod
*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont see any problem with that code, with except setting first name.
for (int i = 0; i < 10; i++) {
// Create empty Entries
elem = wdContext.nodeXXX().createXXXElement();
wdContext.nodeXXX().addElemen(elem);
}
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
According to your code -
Context
nodeXXX \ FirstName Ten elements created for the node . So , i think they are rows ............not columns FirstName = "" FirstName="" - When you refer to a column ,,,, there must be different attributes...like Context |
nodeXXX
\
FirstName
SecondName
LastName
Address
Phone number...
-
Code wise , when you have decided fixed number of columns ...for loop is essential.
Your code is OK . but take care of what u r doing ,,,whether rows or columns???
xxxxxxxxxxxxxxxxx
Let me know , further if u have any doubts.
Thanks ,
Srini
Edited by: Armin Reichert on Apr 26, 2008 6:57 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.