on 05-04-2010 9:25 AM
Hi All,
I have a requirement that based on date few records of a table should displayed in red and others should be in normal color.
Please help me out how to achieve this.
Thanks
Supriya.
If you want to change the color of table row follow this
http://wiki.sdn.sap.com/wiki/display/Snippets/CreatingaColorLegendinaTableinWeb+Dynpro
In order to change the color of table content, use the textView ui element in table and set the design property.
Vinod V.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod,
I did in that way. By doing that way all the records will take the same color. My requirement depending on a condition few records should come in red color and others in normal manner.
For this ar runtime i should set the text view's property of each table column to red or normal depending on the condition check. How to catch hold of the text view at run time is my question.
Thanks
Supriya.
I have verified it. its working fine for me.
code sample.
String names[] = { "a", "b", "c", "d"};
IPrivateTestAplCompView.ITestElement element;
IPrivateTestAplCompView.ITestNode test = wdContext.nodeTest();
int i = 0;
for( String name : names){
element = test.createAndAddTestElement();
/** you may set condition here*/
element.setDesignClr( WDTextViewSemanticColor.valueOf( ++i));
element.setName( name);
element.setDetails( "other details");
}
Ensure that you have binded the property with context attribute DesignClr
Vinod V.
Hi Supriya,
It is possible to read all element of the table node at run time. For this you have to read node element and based on your logic you can set particular line items/elements text viewu2019s color.
You can read element by below code:-
Based on the size of node you can run a for loop
for(int i=0;i<wdContext.nodeVn_Node().size();i++)
* wdContext.nodeVn_Node().getElementAt(0).getAttributeValue("Name");*
at this point you to have placed your logic and you can set color for particular row based on the previous reply by others.
Hope this may help you.
Deepak!!!
Hi Supriya,
You can access UI element like blow code:-
IWDTextView txtView = (IWDTextView)view.getElement(String name); name will be ID of UI.
/* view used be of type com.sap.tc.webdynpro.progmodel.api.IWDView view*/
txtView.bindSemanticColor(String name); name will be color code
Hope this may help you.
Deepak!!!
Edited by: Deepak Arora on May 5, 2010 10:10 AM
Hi Supriya,
Well you also few more options to look into, which might give you more idea:
[TechEd 2007: CD254 - Developing State-of-the-Art Table UIs in Web Dynpro Java - SAP NetWeaver 7.0|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7436] [original link is broken] [original link is broken] [original link is broken];
[Colourful Table in Web Dynpro|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3548] [original link is broken] [original link is broken] [original link is broken];
Table Popin is too one good option for your requirement.
Hope it helps!
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 Supriya,
This situation can be handled in the following way by using Textview as table cell editor, use the property of Textview called Semanticolor option to display the output in different color.
wdContext.currentContextElement().setAttributeValue(WDTextViewSemanticColor.CRITICAL);
the above option for "RED" color, there are few more color option. please go ahead.
Thanks
Sathya
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.