on 07-31-2008 3:38 PM
Hi..
I have 3 columns in a table . of which in one column we need to change the cell editor dynamically at runtime.
i.e for example i have columns as carrid, connid and fldate.
For the first 2 rows the cell editor for the carrid clomn shud be a dropdown and from there on in the next rows for the same carrid column it shud be a input field.
Can experts plz help me how to achieve this as this is very high priority issue....
Regards,
Madhu...
This is actaully fairly simple to do. You will need to add a cellVariant to your table column. You can then dataBind a context attribute to the selectedCellVariant property of the column to control which cellVariant will be used. This allows you to control row-by-row which cell editor you want to output.
http://help.sap.com/saphelp_nw70/helpdata/EN/bd/5d9041d3c72e7be10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/EN/56/5e9041d3c72e7be10000000a1550b0/frameset.htm
Also here is an example that I did the other day that uses Cell Variants within ALV. This process is actually a little more complicated because you have to go through the ALV APIs. To do this in a normal table is actually easier because you can create the cellVariant in the layout designer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Thomas..
Thanks for the quick reply....
I created the design as u said and added cellvariant in the table column.I selected the cell variant type as STANDARD CELL.
I also created a attribute in the same node for which the table is binded of type string...
But what is the value i need to pass to this attribute to bind to selectedcellvariant property..
What is the value i need to pass if it is dropdown and what shud be passed in case of inputfield.
If two rows need dropdown can i write a supply function for the same ..
Regards,
Madhu..
When you created the CellVariant, there is a property called the variantKey. Whatever value you supply here is what need to have in your attribute bound to selectedCellVariant to trigger using this particular variant. No value supplied to selectedCellVariant will result in the standard editor being used.
>If two rows need dropdown can i write a supply function for the same ..
I'm afraid that I don't understand this question. The UI element sin the CellVariant work just like they would if they were the primary editor.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.