on 2005 Jul 06 11:07 AM
Hi there!
I would like to dynamically modify a table (in the model, via Adaptive RFC) at runtime.
1) Remove table columns
2) color rows/cells different colors based on the certain flags.
I have done this before in HTMLb with Java iViews, but never webdynpro. How would I go about this? Which methods would do this? Do I create the table first in the View in design time, then modify it, or everything at runtime?
Thanks!
Cheers,
faB
Just check this.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/co... webdynpro applications.pdf
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the table is now being modified dynamically, thanks to your help.
Regarding colours, it seems that it is not possible to highlight a single cell or row by changing the background color, like is possible in HTMLb. Has anyone managed to somehow change the font size or color to achieve the same effect?
I suppose another option would be to create an additional column and insert a nice graphic if it is marked as a special row.
Thanks for your input and ideas.
Regards,
faB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi faB,
If you would like to change the color of the cell based on some condition then it is possible. You can achieve this using supply function.
1. Refer the blog for "Supply functions in WebDynpro"
/people/sap.user72/blog/2005/03/15/supply-functions-in-webdynpro
2. Under the value node create an attribute (if you want to set the color for all the columns in a single row, if u want to set the different color for each column then you have to create that many no. of value attributes) of type "com.sap.tc.webdynpro.clientserver.uielib.standard.api.WDTextViewSemanticColor".
3. Bind the attribute to the cellEditor's "semanticColor" property.
4. In the supply function method, set the color of value based on the condition.
If you require any further clarification let me know.
Regards,
Santhosh.C
Hello,
final IWDTable table = (IWDTable)view.getElement("<<ID of the table UIEelement>>");
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try
table.removeColumn(<<Index>>)
this will remove the column.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
If u want to remove the elements frm a table column you can get the element(say elem) and use
elem.removeElement()...
(Ya . sorry .. this will remove the row element...not the columns)
And for setting the colour.. u can change the selection colour using themes.. but generally depending on flag u cant change the column as such.
One way is to set the semantic Colour if u r using the text view as the table cell editor
Regards
Bharathwaj
Message was edited by: Bharathwaj R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not exactly.
final IWDTable table = (IWDTable)view.getElement("id-of-table");
final IWDTableColumn col = table.removeColumn(idx-of-column);
col.destroy();
/* otherwise memory leaks are guaranted */
Code should be placed into wdDoModifyView. It is better to set condition to remove col an col index via some context attribute from action handler.
VS
Hi Valery,
Thanks for the response. However, the (adapted) code wouldn't compile.
In the first line, there was no method ".getElement" of the view. I implemented it like this:
final IWDTable table = (IWDTable)PriceListView.getElement("PriceTable");
also on the last line
col.destry();
didn't exist, only
col.destroyHeader(); or
col.destroyTableCellEditor();
Can you say what i am doing wrong?
Big thanks.
Regards,
faB
User | Count |
---|---|
66 | |
10 | |
10 | |
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.