on 05-24-2013 11:17 AM
Hi All,
We are working on a PoC for a client in Webdynpro java. In webdynpro java table which is editable (columns are input fields) is there any work around so that we can make particular row / cell in that table as non- editable. We don’t want to make entire column as non editable. If anyone worked on this please let us know.
regards
vamsi krishna
This can be accomplished with table cell variants. The following links will give you an idea on how to implement it.
http://scn.sap.com/docs/DOC-2563
http://wiki.sdn.sap.com/wiki/display/WDJava/Using+Table+Cell+Variants+in+NW+2004s
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vamsi,
Firstly, did you achieve your requirement for making particular row/cell as non-editable in Table?
If not, read below:
I saw your comments on Using Table Cell Variants in NW 2004s , and you've not "..make particular row / cell in that table as non- editable..." specified anywhere that what is the condition for any particular cell/row to be non-editable.
Anyways, I just made/extended the wiki code by changing a little to get the below:
If my condition is to make the 4th row cells as non editable - with the code change the above (screen 2) made possible. Where as the rest of the row cells are open for editing as expected required by you.
Thanks,
MS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vamsi,
Change your getTableDataVariant with the above code with your own condition, and I hope it clears your doubt on how to make row cells as non-editable of your choice!
For your question on just NAME filed to be non-editable and keep others editable, I think we should be using SingleMarkableCell..!
Thanks,
MS
Hi,
You can create a boolean attribute within the context node bound to the dataSource property of your table. Bind this boolean attribute to the editable property of your input field in which ever column you want this.
Then, when you are populating data in your table, depending on your conditions (to make the input field editable/non-editable) set this boolean attribute either true (input field is editable) or false (input field non-editable).
Regards,
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vamsi,
After binding the column's input field editable property with the boolean context attribute (this attribute should not be created directly under the root Context node, but under the context node which you are binding to your table's dataSource property), while populating data in the table write the logic for making specific cells editable/non-editable as below:
//suppose you want to make cells in even rows non-editable and odd rows editable
for(int i=0; i<Node.size(); i++)
{
if(i%2 == 0) {
//set the boolean attribute as false so the cell at this index becomes non-editable
}
else {
//set the boolean attribute as true making cells at this index as editable
}
//code to populate data in remaining columns of table
}
In this way, depending on your condition on which you want to make specific cells editable, this can be achieved.
Regards,
Saurabh
Hi Vamsee,
Please reffer below document.
I hope this is help full for you.
Regards
Vijay Kumar Kalluri
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 | |
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.